Defer media loading and strengthen persistence tests
All checks were successful
Deploy Sokko G / deploy (push) Successful in 18s

This commit is contained in:
Shinuwa 2026-09-12 23:28:05 +02:00
parent 09a2d4b71a
commit d0e1fd73b1
19 changed files with 459 additions and 71 deletions

View file

@ -15,20 +15,17 @@ function countLines(source) {
return source.trimEnd().split("\n").length;
}
test("toolbox storage, cards and pages are wired", async () => {
const source = await readFile("website/src/main.jsx", "utf8");
test("toolbox cards and pages retain their public UI conventions", async () => {
const toolboxCard = await readFile("website/src/features/toolboxes/ToolboxCard.jsx", "utf8");
const toolboxPages = await readFile("website/src/features/toolboxes/ToolboxPages.jsx", "utf8");
const toolboxCoverEditor = await readFile("website/src/features/toolboxes/ToolboxCoverEditor.jsx", "utf8");
const toolboxActions = await readFile("website/src/features/toolboxes/useToolboxActions.js", "utf8");
const toolboxStorage = await readFile("website/src/features/toolboxes/storage/toolboxStorage.js", "utf8");
const storageCompactorRegistry = await readFile("website/src/features/toolboxes/storage/modules/index.js", "utf8");
const checklistStorage = await readFile("website/src/features/toolboxes/storage/modules/checklist.js", "utf8");
const timerStorage = await readFile("website/src/features/toolboxes/storage/modules/timer.js", "utf8");
const calendarStorage = await readFile("website/src/features/toolboxes/storage/modules/calendar.js", "utf8");
const resetUtils = await readFile("website/src/features/toolboxes/modules/resetUtils.js", "utf8");
const equipmentStorage = await readFile("website/src/features/toolboxes/storage/modules/equipmentPlanner.js", "utf8");
const indexedToolboxesHook = await readFile("website/src/features/toolboxes/storage/useIndexedToolboxes.js", "utf8");
const storageQuota = await readFile("website/src/components/StorageQuota.jsx", "utf8");
const importButton = await readFile("website/src/components/ImportButton.jsx", "utf8");
const guidedTooltipTour = await readFile("website/src/components/GuidedTooltipTour.jsx", "utf8");
@ -36,25 +33,15 @@ test("toolbox storage, cards and pages are wired", async () => {
const groupedReorderHook = await readFile("website/src/hooks/useGroupedReorder.js", "utf8");
const draftFormHook = await readFile("website/src/hooks/useDraftForm.js", "utf8");
assert.match(`${indexedToolboxesHook}\n${toolboxPages}`, /indexedDbStorage\.js/);
assert.match(source, /features\/toolboxes\/storage\/useIndexedToolboxes\.js/);
assert.match(source, /features\/toolboxes\/useToolboxActions\.js/);
assert.match(indexedToolboxesHook, /export function useIndexedToolboxes/);
assert.match(indexedToolboxesHook, /getStorageEstimate/);
assert.match(toolboxActions, /export function useToolboxActions/);
assert.match(toolboxActions, /importAllToolboxesPayload/);
assert.match(toolboxActions, /async function addImageFiles/);
assert.match(toolboxActions, /creationTemplate/);
assert.match(toolboxActions, /type: "memos"/);
assert.match(toolboxActions, /type: "links"/);
assert.match(toolboxActions, /#\/library/);
assert.match(`${source}\n${toolboxActions}`, /features\/toolboxes\/storage\/toolboxStorage\.js/);
assert.match(toolboxStorage, /TOOLBOX_ICON_FILES/);
assert.match(toolboxStorage, /export function normalizeToolboxIcon/);
assert.match(toolboxStorage, /export function normalizeToolboxCustomCover/);
assert.match(toolboxStorage, /customCover: normalizeToolboxCustomCover/);
assert.match(toolboxStorage, /compact\.customCover = normalized\.customCover/);
assert.match(toolboxStorage, /export function createGlobalExportPayload/);
assert.match(checklistStorage, /qtyTarget/);
assert.match(checklistStorage, /qtyCurrent/);
assert.match(checklistStorage, /hideCompletedSections/);
@ -62,23 +49,6 @@ test("toolbox storage, cards and pages are wired", async () => {
assert.match(checklistStorage, /hideWhenComplete/);
assert.match(equipmentStorage, /collapsed/);
assert.match(toolboxStorage, /module\.scrollable/);
assert.match(toolboxStorage, /normalizeLinksData/);
assert.match(toolboxStorage, /normalizeCountersData/);
assert.match(toolboxStorage, /normalizeCombosData/);
assert.match(toolboxStorage, /normalizeCalculatorData/);
assert.match(toolboxStorage, /normalizeTableData/);
assert.match(toolboxStorage, /normalizeTimerData/);
assert.match(toolboxStorage, /normalizeCalendarData/);
assert.match(toolboxStorage, /normalizeTaskPlannerData/);
assert.match(toolboxStorage, /normalizeGoalTreeData/);
assert.match(toolboxStorage, /normalizeEquipmentPlannerData/);
assert.match(toolboxStorage, /summarizeEquipmentPlannerData/);
assert.match(toolboxStorage, /normalizeImageAnnotationData/);
assert.match(toolboxStorage, /export function compactModuleDataForStorage\(type, value\)/);
assert.match(storageCompactorRegistry, /export const MODULE_DATA_COMPACTORS/);
assert.match(storageCompactorRegistry, /timer: compactTimerDataForStorage/);
assert.match(storageCompactorRegistry, /calendar: compactCalendarDataForStorage/);
assert.match(storageCompactorRegistry, /goalTree: compactGoalTreeDataForStorage/);
assert.match(timerStorage, /scrollResults/);
assert.match(calendarStorage, /normalizeCalendarData/);
assert.match(resetUtils, /export function getLatestDailyReset/);