Skip to content

feat(account): PAYMENTS-11934 Add E2E tests for storing payment methods with init - #3278

Merged
Tharaae merged 2 commits into
feat/account-paymentsfrom
PAYMENTS-11934
Oct 15, 2026
Merged

Tharaae merged 2 commits into
feat/account-paymentsfrom
PAYMENTS-11934

Conversation

@Tharaae

@Tharaae Tharaae commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

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.

@Tharaae
Tharaae requested a review from a team as a code owner October 14, 2026 00:31
@changeset-bot

changeset-bot Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 8a3465e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel

vercel Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
catalyst Ready Ready Preview Oct 14, 2026 10:54am UTC

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

Bundle Size Report

Comparing against baseline from 0755fff (2026-10-14).

Metric Baseline Current Delta
Total JS 395.2 kB 396.5 kB +1.3 kB (+0.3%)

Per-Route First Load JS

Route Baseline Current Delta
/(default)/(faceted)/category/[slug]/page 333.3 kB 332.9 kB -0.4 kB (-0.1%)
/(default)/account/payment-methods/add/[paymentMethodId]/page -- 317 kB ✨ NEW

Threshold: 5% increase. Routes with ⚠️ exceed the threshold.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Unlighthouse Performance Comparison — Vercel

Comparing PR preview deployment Unlighthouse scores vs production Unlighthouse scores.

Summary Score

Aggregate score across all categories as reported by Unlighthouse.

Prod Desktop Prod Mobile Preview Desktop Preview Mobile
Score 98 99 99 99

Category Scores

Category Prod Desktop Prod Mobile Preview Desktop Preview Mobile
Performance 100 100 100 100
Accessibility 95 92 95 95
Best Practices 100 100 100 100
SEO 100 100 100 100

Core Web Vitals

Metric Prod Desktop Prod Mobile Preview Desktop Preview Mobile
LCP 0.4 s 0.4 s 0.4 s 0.4 s
CLS 0.039 0 0.001 0.002
FCP 0.3 s 0.4 s 0.4 s 0.4 s
TBT 0 ms 10 ms 0 ms 0 ms
Max Potential FID 30 ms 60 ms 50 ms 50 ms
Time to Interactive 0.3 s 0.7 s 0.4 s 0.4 s

Full Unlighthouse report →

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

Comment on lines +50 to +64
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)}`);
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +45 to +46
if (!response.ok()) {
return undefined;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Narrowed down as only 500 error code may indicate the provider is either unconfigured or not vault-capable.

@Tharaae
Tharaae merged commit 09c1ec8 into feat/account-payments Oct 15, 2026
16 checks passed
@Tharaae
Tharaae deleted the PAYMENTS-11934 branch October 15, 2026 03:48

This branch was successfully deployed

1 active deployment
Preview — 8a3465ef Deployed Oct 14, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants