Skip to content

b5495be1 - Collapse the two IBAN switch buttons into one cycle - #1391

Merged
TaprootFreak merged 4 commits into
developfrom
fix/single-iban-switch-button
Aug 13, 2026
Merged

b5495be1 - Collapse the two IBAN switch buttons into one cycle#1391
TaprootFreak merged 4 commits into
developfrom
fix/single-iban-switch-button

Conversation

@TaprootFreak

@TaprootFreak TaprootFreak commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary

The buy payment-details IBAN row rendered two adjacent switch controls whenever a verified Bank Frick personal IBAN also had a Yapeal alternative: the collection-account SWAP toggle and the provider BANK toggle. That is one job. This change keeps a single SWAP button that cycles through every IBAN actually available on the current quote:

  1. the personal IBAN of the current quote
  2. the Bank Frick collection IBAN, when getOfferableCollectionIban offers one
  3. the other personal-IBAN provider, when personalIbanProviderSwitch is passed

Collection remains a local display change (QR and invoice rewrite unchanged). A provider step still calls onSwitch so the screens request a fresh quote pinned to that provider. Collection-only and provider-only rows keep their previous behaviour, except the provider-only control now uses the same SWAP icon.

Public PaymentInformationContent props are unchanged. Existing translation keys are reused. The provider callback lives on the discriminated switch target; the cycle helper stays file-private.

Tests

Per-file coverage for every instrumented file this pull request touches, measured with:

CI=true npm test -- --watchAll=false --coverage --collectCoverageFrom='src/components/payment/payment-info-buy.tsx' --testPathPattern='payment-info-buy'
File Stmts Branch Funcs Lines
src/components/payment/payment-info-buy.tsx 100 100 100 100

33 unit tests in the payment-info-buy suites passed. Combined-cycle cases pin exactly one switch button, a local first click, and a provider onSwitch on the second click.

The /buy and /buy/info Playwright scenarios step through collection first on a verified Frick CHF quote, then switch to Yapeal. Their four provider-toggle baselines (buy-chf-provider-toggle-*, buy-info-provider-toggle-*) are regenerated and show one SWAP control. The matching full-stack tests in e2e-stack/specs/buy.spec.ts assert that Payment Information never renders more than one IBAN switch button.

The payment-details IBAN row showed a collection-account SWAP toggle and a
provider BANK toggle side by side whenever both alternatives existed.
Customers only need one control: a single SWAP button now walks personal
→ collection (when offered) → the other personal-IBAN provider (when
offered). Collection stays a local display change; a provider step still
requests a fresh quote.
The provider callback now lives on the discriminated switch target, so
the unreachable exported fail-closed throw is gone. Tests cover the
cycle only through PaymentInformationContent.
The full-stack /buy and /buy/info flows already reach Payment Information.
They now also assert that at most one IBAN switch button is rendered, so
the two-control regression cannot land again even when this stack does
not seed a personal-IBAN provider.
@TaprootFreak

TaprootFreak commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

EN: Ready after 4 review passes.
DE: Bereit nach 4 Review-Durchläufen.

Details

Review passes:

  1. Exported cycle helper existed only so a test could hit an unreachable throw. The provider callback now lives on the discriminated switch target; the helper is file-private.
  2. The matching full-stack /buy and /buy/info tests assert that Payment Information never renders more than one IBAN switch button.
  3. No remaining code findings.
  4. Provider-toggle Playwright baselines were regenerated and show one SWAP control instead of SWAP plus bank icons. Collection-only baselines are unchanged.

Comments: none open besides this note (no review threads).
Mergeability: mergeable: MERGEABLE at head 32d55263.
CI at that head: Build and test, Full-stack E2E, review, CodeQL, and CodeQL Analyze jobs all SUCCESS. Handbook image check is draft-skipped by design and runs on ready.

@TaprootFreak
TaprootFreak marked this pull request as ready for review August 13, 2026 15:56
@TaprootFreak
TaprootFreak marked this pull request as draft August 13, 2026 18:54
The Frick and Yapeal payment-details screenshots now show one SWAP
button instead of the previous SWAP plus bank icons. Collection-only
baselines are unchanged.
@TaprootFreak
TaprootFreak marked this pull request as ready for review August 13, 2026 19:24
@TaprootFreak
TaprootFreak merged commit aad2979 into develop Aug 13, 2026
12 of 13 checks passed
@TaprootFreak
TaprootFreak deleted the fix/single-iban-switch-button branch August 13, 2026 19:59
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.

1 participant