network-failure-e2e-test.cy.ts — 8 tests
Why it matters
Previously, there was no test coverage for error handling. Recent fixes in PRs #1375, #1389, and #1340 were shipped without safeguards against regressions. This suite ensures those scenarios are now reliably tested.
Test Coverage
| Test |
What it verifies |
| 500 on confirm → error displayed |
Confirms the SDK surfaces an error message when the payment confirmation API fails |
| 402 decline → submit re-enabled |
Ensures the submit button is re-enabled after a card decline (regression coverage for PR #1375) |
| Declined card → error message shown |
Verifies that a real sandbox decline triggers the correct UI error message |
| In-flight request → button disabled |
Confirms the submit button is disabled while a payment is processing |
| PM API 503 → graceful fallback |
Ensures the SDK renders a fallback UI instead of breaking when the API returns 503 |
| PM API 500 → graceful fallback |
Same as above, but for 500 responses |
| API key header present on PM request |
Verifies the publishable key is sent correctly and not truncated (regression for PR #1389) |
| Headers on confirm call are correct |
Ensures required headers (Content-Type, api-key) are included (regression for PR #1340) |
network-failure-e2e-test.cy.ts — 8 tests
Why it matters
Previously, there was no test coverage for error handling. Recent fixes in PRs #1375, #1389, and #1340 were shipped without safeguards against regressions. This suite ensures those scenarios are now reliably tested.
Test Coverage
Content-Type,api-key) are included (regression for PR #1340)