Improve toolbox ordering and persistence test coverage
All checks were successful
Deploy Sokko G / deploy (push) Successful in 19s
All checks were successful
Deploy Sokko G / deploy (push) Successful in 19s
This commit is contained in:
parent
6bcde57e88
commit
62138120ee
5 changed files with 73 additions and 4 deletions
|
|
@ -99,10 +99,6 @@ test("toolbox cards and pages retain their public UI conventions", async () => {
|
|||
assert.match(storageQuota, /role="progressbar"/);
|
||||
assert.match(importButton, /export function ImportButton/);
|
||||
assert.match(importButton, /accept="application\/json"/);
|
||||
assert.match(groupedReorderHook, /export function useGroupedReorder/);
|
||||
assert.match(groupedReorderHook, /usePointerReorder/);
|
||||
assert.match(groupedReorderHook, /export function getGroupedEntries/);
|
||||
assert.match(groupedReorderHook, /export function applyGroupedReorderOperation/);
|
||||
assert.match(groupedReorderHook, /data-reorder-orientation/);
|
||||
assert.match(groupedReorderHook, /operation\.sourceParentId === operation\.targetParentId/);
|
||||
assert.match(toolboxCoverEditor, /image\/webp/);
|
||||
|
|
|
|||
|
|
@ -1025,6 +1025,7 @@ test("toolbox export remaps randomizer multi-target exclusions", () => {
|
|||
});
|
||||
|
||||
test("grouped reorder helpers group flat items and complete group order", () => {
|
||||
assert.deepEqual(getGroupedEntries([], { getItemGroup: (item) => item.category }), []);
|
||||
const items = [
|
||||
{ id: "a", category: "" },
|
||||
{ id: "b", category: "Boss" },
|
||||
|
|
@ -1086,6 +1087,8 @@ test("grouped reorder operation moves items in and out of categories", () => {
|
|||
}
|
||||
};
|
||||
|
||||
const original = structuredClone(data);
|
||||
|
||||
const movedIn = applyGroupedReorderOperation(data, {
|
||||
...config,
|
||||
operation: {
|
||||
|
|
@ -1120,6 +1123,9 @@ test("grouped reorder operation moves items in and out of categories", () => {
|
|||
});
|
||||
|
||||
assert.deepEqual(movedOut.items.map((item) => `${item.id}:${item.category || ""}`), ["b:Boss", "c:Boss", "a:", "d:Farm"]);
|
||||
assert.deepEqual(data, original);
|
||||
assert.deepEqual(movedIn.items.map((item) => `${item.id}:${item.category || ""}`), ["b:Boss", "c:Boss", "a:Farm", "d:Farm"]);
|
||||
assert.equal(applyGroupedReorderOperation(data, { ...config, operation: { type: "unknown" } }), data);
|
||||
});
|
||||
|
||||
test("grouped reorder operation moves whole categories", () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue