test(ui): await recent-chats render in lighthouse panel chat test (#12096)

Co-authored-by: Pablo F.G <pablo.fernandez@prowler.com>
This commit is contained in:
Pablo Fernandez Guerra (PFE)
2026-07-23 09:51:34 +02:00
committed by GitHub
parent 2f6aedf291
commit 9f5ef80e69
@@ -170,11 +170,12 @@ describe("LighthousePanelChat", () => {
// When
render(<LighthousePanelChat />);
// 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();