diff --git a/ui/app/(prowler)/lighthouse/_components/panel/lighthouse-panel-chat.test.tsx b/ui/app/(prowler)/lighthouse/_components/panel/lighthouse-panel-chat.test.tsx index f903bd87e2..706ed7420d 100644 --- a/ui/app/(prowler)/lighthouse/_components/panel/lighthouse-panel-chat.test.tsx +++ b/ui/app/(prowler)/lighthouse/_components/panel/lighthouse-panel-chat.test.tsx @@ -170,11 +170,12 @@ describe("LighthousePanelChat", () => { // When render(); - // Then: composer is live and the empty state lists recent chats + // Then: composer is live and the empty state lists recent chats. + // Sessions load on a later render than the composer, so await them. expect( await screen.findByRole("textbox", { name: "Message" }), ).toBeInTheDocument(); - expect(screen.getByText("Recent chats")).toBeInTheDocument(); + expect(await screen.findByText("Recent chats")).toBeInTheDocument(); expect( await screen.findByText("Counting critical findings"), ).toBeInTheDocument();