fix(admin): harden clothing/pets/effects/clone imports
Align grids on data.items, only treat SSE done as success, hard-fail clothing sets when libs fail, and add Cancel via AbortController. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
1 parent
9c4949186c
commit
16191cef14
8 files changed
+344
-173
No files matched your search
@@ -87,4 +87,20 @@ describe("importClothingSet", () => {
|
||||
const r = await importClothingSet({ setType: "ch", setId: 999999 });
|
||||
expect(r.ok).toBe(false);
|
||||
});
|
||||
|
||||
it("does not write set data when a required library import fails", async () => {
|
||||
mergeSet.mockClear();
|
||||
mergePalette.mockClear();
|
||||
importSingleFigure.mockResolvedValueOnce({
|
||||
ok: false,
|
||||
lib: "shirt_M_x",
|
||||
warnings: [],
|
||||
error: "nitro missing",
|
||||
});
|
||||
const r = await importClothingSet({ setType: "ch", setId: 5000 });
|
||||
expect(r.ok).toBe(false);
|
||||
expect(r.error).toMatch(/required figure libraries failed/i);
|
||||
expect(mergeSet).not.toHaveBeenCalled();
|
||||
expect(mergePalette).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user