test(unit): add lightweight vitest coverage for auth duration and seq pagination utils
This commit is contained in:
14
Fabric.Backend.Center/src/auth/token.util.spec.ts
Normal file
14
Fabric.Backend.Center/src/auth/token.util.spec.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { parseDurationToSeconds } from './token.util';
|
||||
|
||||
describe('parseDurationToSeconds', () => {
|
||||
it('parses time units', () => {
|
||||
expect(parseDurationToSeconds('15m', 1)).toBe(900);
|
||||
expect(parseDurationToSeconds('2h', 1)).toBe(7200);
|
||||
expect(parseDurationToSeconds('10', 1)).toBe(10);
|
||||
});
|
||||
|
||||
it('falls back on invalid input', () => {
|
||||
expect(parseDurationToSeconds('abc', 42)).toBe(42);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user