From 27aab5c7830da6b43e98b9fadd2d14b43bcafe59 Mon Sep 17 00:00:00 2001 From: Maurice Date: Sat, 7 Nov 2026 23:59:38 +0100 Subject: [PATCH] test(journey): wait for the dropped create parameter to reach the URL The draft opens and the parameter goes in the same effect, but the URL shows it a render later. Under CI load the check ran in between and saw ?create=entry; it now waits for the empty search like it waits for the draft. --- client/src/pages/journeyDetail/useJourneyDetail.test.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/src/pages/journeyDetail/useJourneyDetail.test.tsx b/client/src/pages/journeyDetail/useJourneyDetail.test.tsx index b4e8a2ef0..2f6168d15 100644 --- a/client/src/pages/journeyDetail/useJourneyDetail.test.tsx +++ b/client/src/pages/journeyDetail/useJourneyDetail.test.tsx @@ -162,7 +162,8 @@ describe('useJourneyDetail', () => { setup({ search: '?create=entry' }); await waitFor(() => expect(latest.editingEntry).not.toBeNull()); expect(latest.editingEntry).toMatchObject({ id: 0, journey_id: 7, type: 'entry', visibility: 'private' }); - expect(screen.getByTestId('search')).toHaveTextContent(''); + // The parameter goes in the same effect but reaches the URL a render later. + await waitFor(() => expect(screen.getByTestId('search')).toBeEmptyDOMElement()); }); it('FE-JRN-DETHOOK-004: a viewer never gets the draft editor', async () => {