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(auth): passkey controller mocks need request headers now

Maurice2d6454976e19
diff --git a/server/tests/unit/nest/auth-guard.test.ts b/server/tests/unit/nest/auth-guard.test.ts
index 2743adf5c..bcaf9a8c6 100644
--- a/server/tests/unit/nest/auth-guard.test.ts
+++ b/server/tests/unit/nest/auth-guard.test.ts
@@ -201,7 +201,7 @@ describe('CurrentUser decorator', () => {
});
describe('PasskeyController', () => {
- const req = { ip: '9.9.9.9' } as Request;
+ const req = { ip: '9.9.9.9', headers: {} } as Request;
const res = {} as never;
function rl(): RateLimitService { return new RateLimitService(); }
@@ -269,7 +269,7 @@ describe('PasskeyController', () => {
it('falls back to the "unknown" rate-limit key when req.ip is absent', async () => {
passkey.passkeyLoginOptions.mockResolvedValue({ options: { challenge: 'z' } } as never);
- const noIp = {} as Request;
+ const noIp = { headers: {} } as Request;
expect(await pc(rl()).loginOptions(noIp)).toEqual({ challenge: 'z' });
});
});