mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
test: deepen integration tests for 11 medium tools (HEIC, large file, batch, edge cases)
This commit is contained in:
@@ -400,6 +400,46 @@ describe("HEIF input", () => {
|
||||
});
|
||||
});
|
||||
|
||||
// ── Animated GIF input ──────────────────────────────────────────
|
||||
describe("Animated GIF input", () => {
|
||||
it("extracts palette from animated GIF", async () => {
|
||||
const GIF = readFileSync(join(FIXTURES, "animated.gif"));
|
||||
const { body: payload, contentType } = makeFilePayload(GIF, "anim.gif", "image/gif");
|
||||
const res = await app.inject({
|
||||
method: "POST",
|
||||
url: "/api/v1/tools/color-palette",
|
||||
payload,
|
||||
headers: {
|
||||
"content-type": contentType,
|
||||
authorization: `Bearer ${adminToken}`,
|
||||
},
|
||||
});
|
||||
expect(res.statusCode).toBe(200);
|
||||
const result = JSON.parse(res.body);
|
||||
expect(result.colors.length).toBeGreaterThan(0);
|
||||
});
|
||||
});
|
||||
|
||||
// ── SVG input ───────────────────────────────────────────────────
|
||||
describe("SVG input", () => {
|
||||
it("extracts palette from SVG image", async () => {
|
||||
const SVG = readFileSync(join(FIXTURES, "test-100x100.svg"));
|
||||
const { body: payload, contentType } = makeFilePayload(SVG, "icon.svg", "image/svg+xml");
|
||||
const res = await app.inject({
|
||||
method: "POST",
|
||||
url: "/api/v1/tools/color-palette",
|
||||
payload,
|
||||
headers: {
|
||||
"content-type": contentType,
|
||||
authorization: `Bearer ${adminToken}`,
|
||||
},
|
||||
});
|
||||
expect(res.statusCode).toBe(200);
|
||||
const result = JSON.parse(res.body);
|
||||
expect(result.colors.length).toBeGreaterThan(0);
|
||||
});
|
||||
});
|
||||
|
||||
// ── Filename preserved in response ──────────────────────────────
|
||||
describe("Filename tracking", () => {
|
||||
it("returns the original filename in the response", async () => {
|
||||
|
||||
Reference in New Issue
Block a user