mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-13 15:47:28 +00:00
test: tighten custom theme fetch assertion
This commit is contained in:
@@ -179,14 +179,18 @@ describe("custom theme import helpers", () => {
|
||||
);
|
||||
|
||||
expect(imported.label).toBe("Light Green");
|
||||
expect(fetchImpl).toHaveBeenCalledWith(
|
||||
"https://tweakcn.com/r/themes/cmlhfpjhw000004l4f4ax3m7z",
|
||||
expect.objectContaining({
|
||||
headers: { accept: "application/json" },
|
||||
redirect: "error",
|
||||
signal: expect.any(AbortSignal),
|
||||
}),
|
||||
);
|
||||
const fetchMock = vi.mocked(fetchImpl);
|
||||
expect(fetchMock).toHaveBeenCalledTimes(1);
|
||||
const [fetchUrl, fetchOptions] = fetchMock.mock.calls[0] as [
|
||||
string,
|
||||
{ headers?: unknown; redirect?: unknown; signal?: unknown },
|
||||
];
|
||||
expect(fetchUrl).toBe("https://tweakcn.com/r/themes/cmlhfpjhw000004l4f4ax3m7z");
|
||||
expect(fetchOptions).toMatchObject({
|
||||
headers: { accept: "application/json" },
|
||||
redirect: "error",
|
||||
});
|
||||
expect(fetchOptions.signal).toBeInstanceOf(AbortSignal);
|
||||
});
|
||||
|
||||
it("rejects oversized tweakcn theme responses before parsing", async () => {
|
||||
|
||||
Reference in New Issue
Block a user