feat(admin): reorganize housekeeping and strengthen shared workflows
This commit is contained in:
1 parent
35f66d879f
commit
a070004e7b
35 files changed
+1667
-462
No files matched your search
@@ -0,0 +1,17 @@
|
||||
import { expect, it } from "vitest";
|
||||
import { tablePageNumbers } from "./admin-table-state";
|
||||
|
||||
it.each([
|
||||
[1, 1],
|
||||
[1, 7],
|
||||
[6, 7],
|
||||
[7, 7],
|
||||
[50, 100],
|
||||
[100, 100],
|
||||
])("includes the current page %i/%i and stays in bounds", (page, last) => {
|
||||
const pages = tablePageNumbers(page, last);
|
||||
expect(pages).toContain(page);
|
||||
expect(pages.length).toBeLessThanOrEqual(5);
|
||||
expect(pages.every((p) => p >= 1 && p <= last)).toBe(true);
|
||||
expect(new Set(pages).size).toBe(pages.length);
|
||||
});
|
||||
Reference in new issue
Block a user