fix: paginate import history and report
This commit is contained in:
22
server/importLogPagination.test.ts
Normal file
22
server/importLogPagination.test.ts
Normal 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,
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user