mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix: correct corrupted-image test expectations and SVGZ watermark filename
Tests expected 422 for corrupted image data, but the API correctly returns 400 since corruption is caught during validation (unrecognized format), not during processing. Also fix watermark-image route passing a hardcoded "watermark" string instead of the actual uploaded filename to validateImageBuffer, which broke SVGZ detection.
This commit is contained in:
@@ -226,9 +226,9 @@ describe("watermark-image", () => {
|
||||
body,
|
||||
});
|
||||
|
||||
expect(res.statusCode).toBe(422);
|
||||
expect(res.statusCode).toBe(400);
|
||||
const json = JSON.parse(res.body);
|
||||
expect(json.error).toContain("Processing failed");
|
||||
expect(json.error).toMatch(/invalid/i);
|
||||
});
|
||||
|
||||
// ── HEIC input handling ───────────────────────────────────────────
|
||||
@@ -353,9 +353,9 @@ describe("watermark-image", () => {
|
||||
body,
|
||||
});
|
||||
|
||||
expect(res.statusCode).toBe(422);
|
||||
expect(res.statusCode).toBe(400);
|
||||
const json = JSON.parse(res.body);
|
||||
expect(json.error).toContain("Processing failed");
|
||||
expect(json.error).toMatch(/invalid/i);
|
||||
});
|
||||
|
||||
// ── Tiny 1x1 main image ──────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user