This commit is contained in:
1 parent
8efd032cc6
commit
df38dccbf1
735 files changed
+128321
-120870
No files matched your search
@@ -2,45 +2,55 @@
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
|
||||
vi.mock("@/lib/prisma", () => ({
|
||||
prisma: {},
|
||||
prisma: {},
|
||||
}));
|
||||
|
||||
vi.mock("@/lib/services/furni-data", () => ({
|
||||
appendFurniEntry: vi.fn(),
|
||||
buildFurniEntry: vi.fn(),
|
||||
removeFurniEntry: vi.fn(),
|
||||
appendFurniEntry: vi.fn(),
|
||||
buildFurniEntry: vi.fn(),
|
||||
removeFurniEntry: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock("@/lib/services/habbo-furnidata-cache", () => ({
|
||||
lookupHabboIt: vi.fn(),
|
||||
lookupHabboIt: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock("@/lib/services/import/core/download", () => ({
|
||||
downloadFile: vi.fn(),
|
||||
validatePngBytes: vi.fn(),
|
||||
validateSwfBytes: vi.fn(),
|
||||
downloadFile: vi.fn(),
|
||||
validatePngBytes: vi.fn(),
|
||||
validateSwfBytes: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock("@/lib/services/swf-to-nitro", () => ({
|
||||
convertSwfToNitro: vi.fn(),
|
||||
extractIconFromSwf: vi.fn(),
|
||||
convertSwfToNitro: vi.fn(),
|
||||
extractIconFromSwf: vi.fn(),
|
||||
}));
|
||||
|
||||
import { buildItemsBaseEnrichmentUpdate } from "./furni-import";
|
||||
|
||||
describe("buildItemsBaseEnrichmentUpdate", () => {
|
||||
it("only updates columns present in the live Arcturus items_base schema", () => {
|
||||
const update = buildItemsBaseEnrichmentUpdate({
|
||||
id: 123,
|
||||
dims: { x: 2, y: 3, z: 1.5 },
|
||||
cansiton: true,
|
||||
canlayon: false,
|
||||
canstandon: true,
|
||||
allowStack: "1",
|
||||
interactionType: "default",
|
||||
});
|
||||
it("only updates columns present in the live Arcturus items_base schema", () => {
|
||||
const update = buildItemsBaseEnrichmentUpdate({
|
||||
id: 123,
|
||||
dims: { x: 2, y: 3, z: 1.5 },
|
||||
cansiton: true,
|
||||
canlayon: false,
|
||||
canstandon: true,
|
||||
allowStack: "1",
|
||||
interactionType: "default",
|
||||
});
|
||||
|
||||
expect(update.sql).not.toContain("specialtype");
|
||||
expect(update.values).toEqual([2, 3, 1.5, "1", "0", "1", "1", "default", 123]);
|
||||
});
|
||||
expect(update.sql).not.toContain("specialtype");
|
||||
expect(update.values).toEqual([
|
||||
2,
|
||||
3,
|
||||
1.5,
|
||||
"1",
|
||||
"0",
|
||||
"1",
|
||||
"1",
|
||||
"default",
|
||||
123,
|
||||
]);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user