feat: bootstrap from Fabric monorepo

This commit is contained in:
nav
2026-05-13 07:06:03 +00:00
commit d9c5175233
46 changed files with 7808 additions and 0 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);
});
});