From 7708860daecc019314e363233eebdc79568e63a9 Mon Sep 17 00:00:00 2001 From: Charles Vien Date: Sat, 25 Jul 2026 17:04:04 -0700 Subject: [PATCH] wait for deselected loops tab panel to unmount --- .../src/features/loops/components/LoopsListView.test.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/ui/src/features/loops/components/LoopsListView.test.tsx b/packages/ui/src/features/loops/components/LoopsListView.test.tsx index cdcba77f7c..f0157a4f04 100644 --- a/packages/ui/src/features/loops/components/LoopsListView.test.tsx +++ b/packages/ui/src/features/loops/components/LoopsListView.test.tsx @@ -1,6 +1,6 @@ import type { LoopSchemas } from "@posthog/api-client/loops"; import { Theme } from "@radix-ui/themes"; -import { render, screen, within } from "@testing-library/react"; +import { render, screen, waitFor, within } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { describe, expect, it, vi } from "vitest"; import { LoopsListViewPresentation } from "./LoopsListView"; @@ -58,6 +58,9 @@ describe("LoopsListViewPresentation", () => { expect( within(controlledPanel(teamTab)).getByText("team loop"), ).toBeVisible(); - expect(controlledPanel(personalTab)).toHaveAttribute("inert"); + // The deselected panel is inert, then unmounts when its transition ends. + await waitFor(() => + expect(screen.queryByText("personal loop")).not.toBeInTheDocument(), + ); }); });