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
|
|
@ -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