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:
@@ -481,10 +481,9 @@ describe("Compare", () => {
|
||||
body,
|
||||
});
|
||||
|
||||
// Should return 422 due to processing failure
|
||||
expect(res.statusCode).toBe(422);
|
||||
expect(res.statusCode).toBe(400);
|
||||
const result = JSON.parse(res.body);
|
||||
expect(result.error).toMatch(/comparison failed/i);
|
||||
expect(result.error).toMatch(/invalid/i);
|
||||
});
|
||||
|
||||
// ── Branch coverage: 1x1 tiny images (line 117-121 area) ───────────
|
||||
@@ -667,9 +666,9 @@ describe("Compare", () => {
|
||||
body,
|
||||
});
|
||||
|
||||
expect(res.statusCode).toBe(422);
|
||||
expect(res.statusCode).toBe(400);
|
||||
const result = JSON.parse(res.body);
|
||||
expect(result.error).toMatch(/comparison failed/i);
|
||||
expect(result.error).toMatch(/invalid/i);
|
||||
});
|
||||
|
||||
// ── Branch coverage: HEIF content format input ─────────────────────
|
||||
|
||||
Reference in New Issue
Block a user