fix: harden automatic mobile boards

This commit is contained in:
ajnart committed 2026-08-13 19:55:17 +02:00
1 parent 5454bcc8ac
commit 967ed8dd73
25 files changed
+490 -92

No files matched your search

+11
View File
@@ -30,6 +30,17 @@ describe("board layout selection", () => {
expect(getCurrentLayout(createBoard(), false, viewportWidth)).toBe(expectedLayoutId);
});
test("legacy mode falls back to the desktop layout before the client viewport is known", () => {
expect(getCurrentLayout(createBoard(), false, undefined)).toBe("large");
});
test("rejects boards without a layout", () => {
const board = { ...createBoard(), layouts: [] };
expect(() => getDesktopLayout(board)).toThrow("Board must have a layout");
expect(() => getCurrentLayout(board, false, 390)).toThrow("Board must have a layout");
});
test("keeps every saved layout available for reversible mutations", () => {
expect(getBoardLayouts(createBoard())).toEqual(["small", "medium", "large"]);
});