Files
SnapOtter/tests/unit/api/async-job-response.test.ts
T
SnapOtterandGitHub f3342a1e57 fix: harden Docker image and async job responses
Harden Docker runtime packaging, preserve async job response semantics, fix Redis subscriber startup connections, clear lint warnings, and harden enterprise S3 object body handling.
2026-07-01 12:32:33 +08:00

21 lines
698 B
TypeScript

import { describe, expect, it } from "vitest";
import { buildAsyncAcceptedPayload } from "../../../apps/api/src/routes/async-response.js";
describe("buildAsyncAcceptedPayload", () => {
it("keeps legacy async shape when the progress and artifact IDs match", () => {
expect(buildAsyncAcceptedPayload("job-123")).toEqual({
jobId: "job-123",
async: true,
});
});
it("exposes both progress and artifact IDs when a client progress ID is supplied", () => {
expect(buildAsyncAcceptedPayload("artifact-123", "progress-456")).toEqual({
jobId: "progress-456",
progressJobId: "progress-456",
artifactJobId: "artifact-123",
async: true,
});
});
});