Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

test(journey): wait for the dropped create parameter to reach the URL

Maurice27aab5c7830d
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 () => {