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:
Tyler
2026-06-20 20:53:58 -06:00
parent bfcb0b3f38
commit cb74bc9307
3 changed files with 162 additions and 3 deletions
+1 -2
View File
@@ -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}` : ""}`,
);