fix: paginate import history and report

This commit is contained in:
Manus
2026-10-09 09:58:08 +00:00
parent 939dddd1d8
commit 6d72547509
7 changed files with 110 additions and 15 deletions

View File

@@ -0,0 +1,22 @@
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,
});
});
});