mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
test(matrix): multi-modality format matrix covering video, audio, document, and data tools
This commit is contained in:
@@ -1201,8 +1201,17 @@ describe("settings variation matrix", () => {
|
||||
|
||||
// For 200 responses, validate response shape
|
||||
if (res.statusCode === 200) {
|
||||
const json = JSON.parse(res.body);
|
||||
expect(json.downloadUrl || json.jobId).toBeTruthy();
|
||||
// Some tools (e.g. split) stream a ZIP binary instead of JSON.
|
||||
// Detect by "PK" magic bytes and skip JSON parsing.
|
||||
const isZip =
|
||||
res.headers["content-type"] === "application/zip" || res.body.startsWith("PK");
|
||||
if (isZip) {
|
||||
expect(res.body.length).toBeGreaterThan(0);
|
||||
} else {
|
||||
const json = JSON.parse(res.body);
|
||||
// image-to-base64 returns { results, errors } instead of downloadUrl
|
||||
expect(json.downloadUrl || json.jobId || json.results).toBeTruthy();
|
||||
}
|
||||
}
|
||||
|
||||
// For 202 (async), just verify the jobId is present
|
||||
|
||||
Reference in New Issue
Block a user