Return null for unknown type in getStateData to prevent empty URL request

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-09 16:31:29 +08:00
parent 5bb89a631d
commit 01385d798d
2 changed files with 9 additions and 0 deletions

View File

@@ -77,6 +77,13 @@ describe("compareStore", () => {
expect(mockGet).toHaveBeenCalledWith("/api/filters/3/discover");
expect(result).toEqual({ cases: 50 });
});
it("returns null for unknown type", async () => {
const result = await store.getStateData("unknown", 1);
expect(mockGet).not.toHaveBeenCalled();
expect(result).toBeNull();
});
});
describe("getFileName", () => {