diff --git a/apps/admin-x-framework/src/test/acceptance.ts b/apps/admin-x-framework/src/test/acceptance.ts index dcf740ce3f..a9ae2063ab 100644 --- a/apps/admin-x-framework/src/test/acceptance.ts +++ b/apps/admin-x-framework/src/test/acceptance.ts @@ -188,8 +188,10 @@ export async function mockApi let requestBody = null; try { + // Try to parse the post data as JSON requestBody = JSON.parse(route.request().postData() || 'null'); } catch { + // Post data isn't JSON (e.g. file upload) — use the raw post data requestBody = route.request().postData(); }