From 05843c8e5b87dd916e9827a9e116da0554cf40b6 Mon Sep 17 00:00:00 2001 From: Maurice Date: Thu, 26 Nov 2026 22:32:44 +0100 Subject: [PATCH] test(oauth): give the pending-code fixture its password version and format the controller test --- .../tests/unit/nest/oauth.controller.test.ts | 18 ++++++++---------- .../unit/nest/process-state-ports.test.ts | 1 + 2 files changed, 9 insertions(+), 10 deletions(-) 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 { resource: null, codeChallenge: 'x', codeChallengeMethod: 'S256', + passwordVersion: 0, expiresAt: Date.now() + 60_000, ...over, };