Repository navigation
feat(account): PAYMENTS-11934 Add E2E tests for storing payment methods with init - #3278
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Bundle Size ReportComparing against baseline from
Per-Route First Load JS
|
Unlighthouse Performance Comparison — VercelComparing PR preview deployment Unlighthouse scores vs production Unlighthouse scores. Summary ScoreAggregate score across all categories as reported by Unlighthouse.
Category Scores
Core Web Vitals
|
There was a problem hiding this comment.
🟡 Changes recommended
Initialization failures can be silently skipped, and cleanup failures can leave test data behind.
2 open findings
What changed in this PR
Adds E2E coverage for vaulting Braintree, Square v2, and Stripe OCS payment methods, including verification and cleanup.
Changes:
- Adds provider-specific vaulting flows and initialization checks.
- Introduces stored-instrument API utilities.
- Adds a fixture for tracking and cleaning up vaulted instruments.
| File | Description |
|---|---|
core/tests/ui/e2e/account/payment-methods-add.spec.ts |
Adds payment-method vaulting tests. |
core/tests/fixtures/utils/api/storedinstruments/index.ts |
Defines stored-instrument API types. |
core/tests/fixtures/utils/api/storedinstruments/http.ts |
Implements instrument listing and deletion. |
core/tests/fixtures/utils/api/index.ts |
Registers the new API client. |
core/tests/fixtures/payment-instrument/index.ts |
Tracks and cleans up vaulted instruments. |
core/tests/fixtures/index.ts |
Registers the payment-instrument fixture. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
| try { | ||
| const newInstruments = await this.listVaultedDuringTest(); | ||
|
|
||
| if (newInstruments.length === 0) { | ||
| return; | ||
| } | ||
|
|
||
| await this.api.storedInstruments.delete( | ||
| customerId, | ||
| newInstruments.map(({ token }) => token), | ||
| ); | ||
| } catch (error) { | ||
| // eslint-disable-next-line no-console | ||
| console.warn(`Could not clean up stored payment instruments: ${String(error)}`); | ||
| } |
There was a problem hiding this comment.
Rate limit is unaffected by how many instruments already exist. Deletion failures will be handled later via UI when the "Delete payment method" feature is implemented.
| if (!response.ok()) { | ||
| return undefined; |
There was a problem hiding this comment.
Narrowed down as only 500 error code may indicate the provider is either unconfigured or not vault-capable.
…leanup after tests
7ebc125 to
8a3465e
Compare

What/Why?
Add E2E tests for the complete flow of storing payment methods that require initialisation: Square v2 and Stripe OCS credit cards.
Testing
E2E tests passes
Migration
A new file will be added when the feature branch is merged.