mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
test: deepen integration tests for 6 simpler tools (HEIC, large file, batch, edge cases)
This commit is contained in:
@@ -587,6 +587,33 @@ describe("Info", () => {
|
||||
expect(typeof result.hasXmp).toBe("boolean");
|
||||
});
|
||||
|
||||
// ── HEIF format info ──────────────────────────────────────────
|
||||
|
||||
it("returns correct metadata for HEIF (sample.heif) image", async () => {
|
||||
const HEIF = readFileSync(join(FIXTURES, "formats", "sample.heif"));
|
||||
const { body, contentType } = createMultipartPayload([
|
||||
{ name: "file", filename: "sample.heif", contentType: "image/heif", content: HEIF },
|
||||
]);
|
||||
|
||||
const res = await app.inject({
|
||||
method: "POST",
|
||||
url: "/api/v1/tools/info",
|
||||
headers: {
|
||||
authorization: `Bearer ${adminToken}`,
|
||||
"content-type": contentType,
|
||||
},
|
||||
body,
|
||||
});
|
||||
|
||||
// HEIF might need system decoder -- skip if 422
|
||||
if (res.statusCode === 422) return;
|
||||
expect(res.statusCode).toBe(200);
|
||||
const result = JSON.parse(res.body);
|
||||
expect(result.width).toBeGreaterThan(0);
|
||||
expect(result.height).toBeGreaterThan(0);
|
||||
expect(result.filename).toBe("sample.heif");
|
||||
});
|
||||
|
||||
// ── Alpha channel detection ─────────────────────────────────────
|
||||
|
||||
it("detects alpha channel in PNG with transparency", async () => {
|
||||
|
||||
Reference in New Issue
Block a user