Short answer

What to know

Use a small immutable file URL with a declared media type and checksum. Payloads includes PDF, MessagePack and CBOR files plus text formats, all listed in one manifest with byte sizes and content-disposition metadata.

Pick a fixture that matches the download path

ScenarioSuggested fixtureExpected media type
Inline PDF preview/v1/files/pdf/dataset-summary.pdfapplication/pdf
Binary save flow/v1/users.msgpackapplication/msgpack
Binary decoder input/v1/users.cborapplication/cbor
CSV export flow/v1/users.csvtext/csv; charset=utf-8

Test the response before the UI

Check status, Content-Type and the number of received bytes before asserting browser-specific behaviour. This tells you whether a failure belongs to the HTTP layer, blob creation, filename handling or the final UI action.

Browser download primitive
const response = await fetch("https://payloads.mochavi.com/v1/files/pdf/dataset-summary.pdf");
if (!response.ok) throw new Error(String(response.status));
if (response.headers.get("content-type") !== "application/pdf") {
  throw new Error("unexpected media type");
}
const file = await response.blob();

Keep end-to-end checks focused

  • Confirm that the control initiates one request.
  • Assert the response media type and a non-zero body.
  • Verify the intended inline or attachment behaviour.
  • Use the manifest checksum when the exact saved bytes matter.
  • Avoid testing a large file when a sub-kilobyte fixture exercises the same code.

Know what is not being simulated

These files do not simulate interrupted transfers, slow responses, expiring links or authenticated downloads. Use a programmable HTTP service for those behaviours. Payloads is for the successful, reproducible file path.