Recognize imported furniture by normalized classname and local IDs
This commit is contained in:
1 parent
9dc6b8a261
commit
a78d8256e0
7 files changed
+254
-46
No files matched your search
@@ -94,4 +94,50 @@ describe("furniture inspection", () => {
|
||||
expect(response.status).toBe(200);
|
||||
expect((await response.json()).items[0].furnidataReadable).toBe(false);
|
||||
});
|
||||
it("recognizes existing SQL and furnidata across classname casing", async () => {
|
||||
mocks.execute
|
||||
.mockResolvedValueOnce([
|
||||
[
|
||||
{
|
||||
id: 2000037258,
|
||||
spriteId: 2000037258,
|
||||
classname: "recycler_kintsugib",
|
||||
name: "Local",
|
||||
type: "s",
|
||||
},
|
||||
],
|
||||
[],
|
||||
])
|
||||
.mockResolvedValueOnce([
|
||||
[
|
||||
{
|
||||
id: 3,
|
||||
pageId: 4,
|
||||
classname: "RECYCLER_KINTSUGIB",
|
||||
credits: 3,
|
||||
points: 0,
|
||||
},
|
||||
],
|
||||
[],
|
||||
]);
|
||||
mocks.read.mockResolvedValue({
|
||||
roomitemtypes: {
|
||||
furnitype: [
|
||||
{ id: 2000037258, classname: "recycler_kintsugib", name: "Local" },
|
||||
],
|
||||
},
|
||||
wallitemtypes: { furnitype: [] },
|
||||
});
|
||||
mocks.stat.mockImplementation(async (filename) => {
|
||||
if (String(filename).includes("kintsugib"))
|
||||
return { size: 256, isFile: () => true };
|
||||
throw { code: "ENOENT" };
|
||||
});
|
||||
const result = await (await POST(request(["recycler_kintsugiB"]))).json();
|
||||
expect(result.items[0].sql[0].id).toBe(2000037258);
|
||||
expect(result.items[0].catalog).toHaveLength(1);
|
||||
expect(result.items[0].furnidata).toHaveLength(1);
|
||||
expect(result.items[0].nitro.exists).toBe(true);
|
||||
expect(result.items[0].icon.exists).toBe(true);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user