test(unit): add lightweight vitest coverage for auth duration and seq pagination utils

This commit is contained in:
nav
2026-05-12 11:53:46 +00:00
parent ec796ae609
commit 41a4172267
11 changed files with 2430 additions and 37 deletions

View File

@@ -0,0 +1,15 @@
import { describe, expect, it } from 'vitest';
import { clampLimit, computeNextExpectedSeq } from './pagination.util';
describe('pagination utils', () => {
it('clamps limit safely', () => {
expect(clampLimit(undefined, 50, 200)).toBe(50);
expect(clampLimit('500', 50, 200)).toBe(200);
expect(clampLimit('-1', 50, 200)).toBe(50);
});
it('computes next expected seq', () => {
expect(computeNextExpectedSeq(1, [1, 2, 3])).toBe(4);
expect(computeNextExpectedSeq(1, [1, 3, 4])).toBe(2);
});
});