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
| Scenario | Suggested fixture | Expected media type |
|---|---|---|
| Inline PDF preview | /v1/files/pdf/dataset-summary.pdf | application/pdf |
| Binary save flow | /v1/users.msgpack | application/msgpack |
| Binary decoder input | /v1/users.cbor | application/cbor |
| CSV export flow | /v1/users.csv | text/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.
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.