test(native): the handoff page's fixture knows the passkey step, and the hook test keeps the real API client around its passkey mocks

This commit is contained in:
Maurice
2026-11-08 18:10:55 +01:00
parent 3a99e8576d
commit cd1f39377d
2 changed files with 21 additions and 4 deletions
@@ -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;