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.
TypeScript budget-trackercollaborativedockeritinerarymcp-serveroffline-firstopen-sourceopenstreetmappacking-listpwareal-timeself-hostedselfhostedtraveltravel-apptravel-journaltravel-plannertripitwanderlog
test(native): the handoff page's fixture knows the passkey step, and the hook test keeps the real API client around its passkey mocks
Mauricecd1f39377d18
diff --git a/client/src/pages/NativeHandoffPage.test.tsx b/client/src/pages/NativeHandoffPage.test.tsxindex 9bf582e76..bfeb70855 100644--- a/client/src/pages/NativeHandoffPage.test.tsx+++ b/client/src/pages/NativeHandoffPage.test.tsx@@ -1,4 +1,4 @@-// FE-NATIVE-HANDOFF-PAGE-001 to FE-NATIVE-HANDOFF-PAGE-004+// FE-NATIVE-HANDOFF-PAGE-001 to FE-NATIVE-HANDOFF-PAGE-005import { beforeEach, describe, expect, it, vi } from 'vitest';import { fireEvent, render, screen } from '../../tests/helpers/render';import NativeHandoffPage from './NativeHandoffPage';@@ -8,6 +8,9 @@ vi.mock('./nativeHandoff/useNativeHandoff', () => ({ useNativeHandoff: vi.fn() }const base = {valid: true,+ passkeyStep: false,+ continueWithPasskey: vi.fn(),+ otherSignIn: vi.fn(),ready: true,userName: 'maria',status: 'idle' as const,@@ -52,4 +55,14 @@ describe('NativeHandoffPage', () => {render(<NativeHandoffPage />);expect(screen.getByText('Signing in did not work. Please try again.')).toBeInTheDocument();});++ it('FE-NATIVE-HANDOFF-PAGE-005: asks for the passkey itself when the app started a passkey sign-in', () => {+ vi.mocked(useNativeHandoff).mockReturnValue({ ...base, passkeyStep: true, ready: false });+ render(<NativeHandoffPage />);+ const buttons = screen.getAllByRole('button');+ fireEvent.click(buttons[0]);+ expect(base.continueWithPasskey).toHaveBeenCalled();+ fireEvent.click(buttons[1]);+ expect(base.otherSignIn).toHaveBeenCalled();+ });});diff --git a/client/src/pages/nativeHandoff/useNativeHandoff.test.tsx b/client/src/pages/nativeHandoff/useNativeHandoff.test.tsxindex db5002e69..c05a95b7b 100644--- a/client/src/pages/nativeHandoff/useNativeHandoff.test.tsx+++ b/client/src/pages/nativeHandoff/useNativeHandoff.test.tsx@@ -22,9 +22,13 @@ vi.mock('../../native/browserSignIn', () => ({}));vi.mock('@simplewebauthn/browser', () => ({ startAuthentication: vi.fn() }));-vi.mock('../../api/client', () => ({- authApi: { passkey: { loginOptions: vi.fn(), loginVerify: vi.fn() } },-}));+vi.mock('../../api/client', async () => {+ const actual = await vi.importActual<typeof import('../../api/client')>('../../api/client');+ return {+ ...actual,+ authApi: { ...actual.authApi, passkey: { ...actual.authApi.passkey, loginOptions: vi.fn(), loginVerify: vi.fn() } },+ };+});const challenge = 'ab'.repeat(32);const realLocation = window.location;