fix(catalog): check source assets and offer reachable import alternatives
This commit is contained in:
1 parent
8c1efae296
commit
159b1f7d1b
10 files changed
+646
-56
No files matched your search
@@ -178,3 +178,22 @@ it("imports recycler_kintsugiB with an allocated ID throughout SQL and furnidata
|
||||
).toContain("2000037258");
|
||||
expect(result.warnings.join(" ")).toContain("16940");
|
||||
});
|
||||
|
||||
it("does not create or delete SQL rows when a new furniture asset is unavailable", async () => {
|
||||
vi.clearAllMocks();
|
||||
mocks.official.mockResolvedValue(null);
|
||||
mocks.download.mockResolvedValue(false);
|
||||
mocks.select.mockImplementation(() => ({
|
||||
from: () => ({ where: () => ({ limit: async () => [] }) }),
|
||||
}));
|
||||
mocks.stat.mockRejectedValue(new Error("missing"));
|
||||
mocks.conflict.mockResolvedValue(null);
|
||||
const result = await importSingleFurni({
|
||||
...input,
|
||||
classname: "missing_new_asset",
|
||||
});
|
||||
expect(result.ok).toBe(false);
|
||||
expect(result.error).toContain("Import not started");
|
||||
expect(mocks.execute).not.toHaveBeenCalled();
|
||||
expect(mocks.append).not.toHaveBeenCalled();
|
||||
});
|
||||
Reference in new issue
Block a user