Skip to content

Add unit tests for the document preview component falling back to a download link when the IPFS gateway times out #56

Description

@Chucks1093

Summary

The document preview fetches the invoice PDF from IPFS and renders it inline. When the gateway times out the component should stop the spinner and show a 'Preview unavailable — download directly' link instead of hanging indefinitely.

Scope

  • Test a successful IPFS fetch renders the PDF preview iframe
  • Test a fetch that times out after 10 seconds shows the download link fallback
  • Test a 404 response shows 'Document not found' rather than the download link
  • Test clicking the download link opens the raw IPFS URL in a new tab
  • Assert the loading spinner is removed in all three cases

Acceptance Criteria

  • Successful fetch renders preview iframe
  • Timeout shows download link fallback
  • 404 shows 'Document not found' message
  • Download link opens raw IPFS URL in new tab
  • Loading spinner removed in all cases

ETA: 12 hours


Coordinate on Telegram

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions