From 9f5ef80e690aa3e19184a30674060a152a2f438d Mon Sep 17 00:00:00 2001 From: "Pablo Fernandez Guerra (PFE)" <148432447+pfe-nazaries@users.noreply.github.com> Date: Thu, 23 Jul 2026 09:51:34 +0200 Subject: [PATCH] test(ui): await recent-chats render in lighthouse panel chat test (#12096) Co-authored-by: Pablo F.G --- .../_components/panel/lighthouse-panel-chat.test.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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();