diff --git a/apps/local/src/App.integration.test.tsx b/apps/local/src/App.integration.test.tsx index e6a777463..0222fad01 100644 --- a/apps/local/src/App.integration.test.tsx +++ b/apps/local/src/App.integration.test.tsx @@ -2988,6 +2988,13 @@ describe("local receiver to viewer integration", () => { expect(detail()).toContain("POST /second"); fireEvent.click(screen.getByLabelText("View event: POST /first")); await waitFor(() => expect(detail()).toContain("POST /first")); + // nuqs writes the URL at most every 50ms, so the click's history entry + // can land after Back unless we wait for it. + await waitFor(() => { + expect( + new URLSearchParams(window.location.search).get("event"), + ).not.toBeNull(); + }); await act(async () => { window.history.back(); });