test(sp8): add coverage for resubmitRejectedWithDownload + bundle modal flow
- inbox-api.test.ts: pin ?download=true POST contract; blob + filename + X-Cyclone-Serialize-Errors parsing; non-2xx error surfacing. - Inbox.test.tsx: end-to-end multi-select → Resubmit + Download path verifies api call args and downloadBlob wiring. - inbox-api.ts: drop redundant isConfigured short-circuit in download variant (backend has its own auth gate) and switch error reading to res.text() to match Blob response shape.
This commit is contained in:
@@ -142,7 +142,6 @@ export async function resubmitRejected(
|
||||
export async function resubmitRejectedWithDownload(
|
||||
claimIds: string[],
|
||||
): Promise<{ blob: Blob; filename: string; serializeErrors: Array<{ claim_id: string; reason: string }> }> {
|
||||
if (!isConfigured) throw notConfiguredError();
|
||||
const res = await fetch(
|
||||
joinUrl("/api/inbox/rejected/resubmit?download=true"),
|
||||
{
|
||||
@@ -152,7 +151,7 @@ export async function resubmitRejectedWithDownload(
|
||||
},
|
||||
);
|
||||
if (!res.ok) {
|
||||
const detail = await readErrorBody(res);
|
||||
const detail = await res.text().catch(() => "");
|
||||
throw new Error(
|
||||
`${res.status} ${res.statusText}${detail ? ` — ${detail}` : ""}`,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user