Improve toolbox checklists, image browsing, and guide integration
All checks were successful
Deploy Sokko G / deploy (push) Successful in 18s
All checks were successful
Deploy Sokko G / deploy (push) Successful in 18s
This commit is contained in:
parent
00e73f0062
commit
386212041f
47 changed files with 744 additions and 112 deletions
|
|
@ -1193,6 +1193,33 @@ test("checklist data drops empty titled sections", () => {
|
|||
assert.deepEqual(compact.sections.map((section) => section.id), ["filled"]);
|
||||
});
|
||||
|
||||
test("checklist completed-item visibility survives compact storage and toolbox export", () => {
|
||||
const data = {
|
||||
hideCompletedItems: true,
|
||||
hideCompletedSections: true,
|
||||
hideCompletedSectionsFully: false,
|
||||
sections: [{ id: "section", title: "Craft", items: [{ id: "item", label: "Ore", qtyTarget: 3, qtyCurrent: 3 }] }]
|
||||
};
|
||||
const normalized = normalizeChecklistData(data);
|
||||
assert.equal(normalized.hideCompletedItems, true);
|
||||
|
||||
const compact = compactModuleDataForStorage("checklist", data);
|
||||
assert.equal(compact.hideCompletedItems, true);
|
||||
assert.equal(compact.hideCompletedSections, true);
|
||||
assert.equal("hideCompletedSectionsFully" in compact, false);
|
||||
assert.deepEqual(compactModuleDataForStorage("checklist", { hideCompletedItems: true, sections: [] }), { hideCompletedItems: true });
|
||||
|
||||
const payload = createToolboxExportPayload({
|
||||
id: "source",
|
||||
name: "Checklist export",
|
||||
modules: [{ id: "checklist", type: "checklist", title: "Checklist" }]
|
||||
}, { [moduleStorageKey("source", "checklist")]: data });
|
||||
const exported = Object.values(payload.modules)[0];
|
||||
assert.equal(exported.hideCompletedItems, true);
|
||||
assert.equal(exported.hideCompletedSections, true);
|
||||
assert.equal(exported.sections[0].items[0].qtyCurrent, 3);
|
||||
});
|
||||
|
||||
test("checklist helpers merge categories and move items deterministically", () => {
|
||||
const context = { uid: (prefix) => `${prefix}-new` };
|
||||
const sections = [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue