feat(catalog): queue furniture imports with history and matching file attachments
CI / check (push) Successful in 1m30s
CI / deploy (push) Successful in 1m26s
CI / e2e (push) Successful in 25s

This commit is contained in:
Simo committed 2026-09-05 17:02:26 +02:00
1 parent 775d14f861
commit 2619bec165
16 files changed
+1016 -232

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
import { expect, it } from "vitest";
import { validateFurnitureAttachment } from "./furni-attachment";
import { createNitroBundle, encodePng } from "./swf/nitro-builder";
const png = encodePng(1, 1, Buffer.from([1, 2, 3, 255]));
it("accepts the matching bundle including color variants sharing a library", () => {
const buffer = createNitroBundle({ name: "chair" }, png, "chair");
expect(validateFurnitureAttachment(buffer, "chair*2")).toBe(buffer);
});
it("rejects a similarly named furniture bundle", () => {
expect(() =>
validateFurnitureAttachment(
createNitroBundle({ name: "china_light" }, png, "china_light"),
"nft_china_light",
),
).toThrow("does not belong");
});
it("rejects a renamed JSON entry with mismatching metadata", () => {
expect(() =>
validateFurnitureAttachment(
createNitroBundle({ name: "china_light" }, png, "nft_china_light"),
"nft_china_light",
),
).toThrow("does not belong");
});
it("rejects missing texture data", () => {
expect(() =>
validateFurnitureAttachment(
createNitroBundle({ name: "chair" }, Buffer.from("not png"), "chair"),
"chair",
),
).toThrow("not a PNG");
});