mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix: accept 422 for BMP tests when ImageMagick unavailable
BMP decoding without ImageMagick returns 422 (not 400). Allow 200/400/422 for BMP input tests matching the existing format-matrix pattern for exotic formats.
This commit is contained in:
@@ -949,7 +949,7 @@ describe("Border", () => {
|
||||
body,
|
||||
});
|
||||
|
||||
expect([200, 400]).toContain(res.statusCode);
|
||||
expect([200, 400, 422]).toContain(res.statusCode);
|
||||
if (res.statusCode === 200) {
|
||||
const result = JSON.parse(res.body);
|
||||
expect(result.processedSize).toBeGreaterThan(0);
|
||||
|
||||
@@ -498,7 +498,7 @@ describe("BMP input", () => {
|
||||
"test.bmp",
|
||||
"image/bmp",
|
||||
);
|
||||
expect([200, 400]).toContain(res.statusCode);
|
||||
expect([200, 400, 422]).toContain(res.statusCode);
|
||||
if (res.statusCode === 200) {
|
||||
const result = JSON.parse(res.body);
|
||||
expect(result.downloadUrl).toBeDefined();
|
||||
|
||||
@@ -522,7 +522,7 @@ describe("BMP input", () => {
|
||||
it("processes BMP image with adaptive sharpening", async () => {
|
||||
const BMP = readFileSync(join(FIXTURES, "formats", "sample.bmp"));
|
||||
const res = await postTool({ method: "adaptive", sigma: 2.0 }, BMP, "test.bmp", "image/bmp");
|
||||
expect([200, 400]).toContain(res.statusCode);
|
||||
expect([200, 400, 422]).toContain(res.statusCode);
|
||||
if (res.statusCode === 200) {
|
||||
const result = JSON.parse(res.body);
|
||||
expect(result.downloadUrl).toBeDefined();
|
||||
|
||||
Reference in New Issue
Block a user