import { describe, expect, it } from "vitest"; import { DEFAULT_IMPORT_LOG_PAGE_SIZE, MAX_IMPORT_LOG_PAGE_SIZE, normalizeImportLogPagination, } from "../shared/importLogPagination"; describe("pagination des journaux d'import", () => { it("retourne une page bornée par défaut au lieu de l'historique complet", () => { expect(normalizeImportLogPagination()).toEqual({ limit: DEFAULT_IMPORT_LOG_PAGE_SIZE, offset: 0, }); }); it("borne les entrées utilisateur pour préserver la réactivité", () => { expect(normalizeImportLogPagination({ limit: MAX_IMPORT_LOG_PAGE_SIZE + 1, offset: -20 })).toEqual({ limit: MAX_IMPORT_LOG_PAGE_SIZE, offset: 0, }); }); });