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(oauth): give the pending-code fixture its password version and format the controller test

Maurice05843c8e5b87
diff --git a/server/tests/unit/nest/oauth.controller.test.ts b/server/tests/unit/nest/oauth.controller.test.ts
index 5f110449e..424235934 100644
--- a/server/tests/unit/nest/oauth.controller.test.ts
+++ b/server/tests/unit/nest/oauth.controller.test.ts
@@ -135,16 +135,14 @@ describe('OauthPublicController /token', () => {
// The password changed since the consent: the code grants nothing, and the refusal is audited.
const stale = makeRes();
const staleSvc = osvc({
- consumeAuthCode: vi
- .fn()
- .mockReturnValue({
- clientId: 'c',
- redirectUri: 'u',
- userId: 1,
- scopes: ['s'],
- codeChallenge: 'cc',
- resource: null,
- }),
+ consumeAuthCode: vi.fn().mockReturnValue({
+ clientId: 'c',
+ redirectUri: 'u',
+ userId: 1,
+ scopes: ['s'],
+ codeChallenge: 'cc',
+ resource: null,
+ }),
authenticateClient: vi.fn().mockReturnValue({ id: 'c' }),
verifyPKCE: vi.fn().mockReturnValue(true),
issueTokensForCode: vi.fn().mockReturnValue(null),
diff --git a/server/tests/unit/nest/process-state-ports.test.ts b/server/tests/unit/nest/process-state-ports.test.ts
index 17a481d2c..8c78b26a9 100644
--- a/server/tests/unit/nest/process-state-ports.test.ts
+++ b/server/tests/unit/nest/process-state-ports.test.ts
@@ -66,6 +66,7 @@ function code(over: Partial<PendingCode> = {}): PendingCode {
resource: null,
codeChallenge: 'x',
codeChallengeMethod: 'S256',
+ passwordVersion: 0,
expiresAt: Date.now() + 60_000,
...over,
};