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): read stored revoked_at raw in OAUTHTOKREPO-003

Mauricead1111858bfe
diff --git a/server/tests/unit/db/repositories/OauthTokens.repository.test.ts b/server/tests/unit/db/repositories/OauthTokens.repository.test.ts
index 3363d2253..9deb4e9e7 100644
--- a/server/tests/unit/db/repositories/OauthTokens.repository.test.ts
+++ b/server/tests/unit/db/repositories/OauthTokens.repository.test.ts
@@ -132,8 +132,12 @@ describe('OauthTokensRepository', () => {
await tokens.revokeAllForClient('proto-3'); // legacy: datetime('now')
await tokens.revokeById(idB); // legacy: CURRENT_TIMESTAMP
- const rowA = await tokenRow(idA);
- const rowB = await tokenRow(idB);
+ // test-sql-allow: the stored text of revoked_at is under test, which DbTimestampType would normalise on read.
+ const rowA = testDb.prepare('SELECT revoked_at FROM oauth_tokens WHERE id = ?').get(idA) as { revoked_at: unknown };
+ // test-sql-allow: the stored text of revoked_at is under test, which DbTimestampType would normalise on read.
+ const rowB = testDb.prepare('SELECT revoked_at FROM oauth_tokens WHERE id = ?').get(idB) as { revoked_at: unknown };
+ expect(typeof rowA.revoked_at).toBe('string');
+ expect(typeof rowB.revoked_at).toBe('string');
expect(rowA.revoked_at).toMatch(/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/);
expect(rowB.revoked_at).toMatch(/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/);
});