-
Notifications
You must be signed in to change notification settings - Fork 20
Fix and add E2E tests for "Link Visa Card with Registration" #7681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: arsforza/fix/link-visa-card-frontend
Are you sure you want to change the base?
Fix and add E2E tests for "Link Visa Card with Registration" #7681
Conversation
64c6929 to
697c6b8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes and enhances the E2E tests for linking and managing Visa debit cards with registrations. The changes include refactoring the link card dialog component to better handle different error states, improving the dialog's state management, and adding comprehensive E2E test coverage for the on-site card linking functionality.
Key Changes:
- Refactored the link card dialog component to use a cleaner state management approach with three distinct error states (card not found, already linked to other registration, already linked to current registration)
- Changed dialog visibility handling from input/output pattern to two-way binding with model signals
- Added new E2E tests for linking and replacing visa cards with proper error scenario coverage
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| interfaces/portal/src/locale/messages.xlf | Reorganized i18n translation keys with updated IDs for error messages |
| interfaces/portal/src/app/pages/program-registration-debit-cards/program-registration-debit-cards.page.html | Updated dialog visibility binding to use two-way binding and removed unnecessary this keyword |
| interfaces/portal/src/app/pages/program-registration-debit-cards/components/link-card-on-site-dialog/link-card-dialog.component.ts | Major refactoring: simplified component inputs/outputs, added error state management, improved token code validation, and added helper methods |
| interfaces/portal/src/app/pages/program-registration-debit-cards/components/link-card-on-site-dialog/link-card-dialog.component.html | Refactored template to consolidate error states, improved button layout, and added data-testid for E2E testing |
| interfaces/portal/src/app/pages/program-registration-debit-cards/components/link-card-on-site-dialog/enums/link-card-dialog-states.enum.ts | Split error state into two distinct states: errorAlreadyLinkedToOther and errorAlreadyLinkedToCurrent |
| e2e/portal/tests/DebitCards/ManageDebitCards.spec.ts | Fixed test selectors to match updated button labels and method names |
| e2e/portal/tests/DebitCards/LinkVisaCardToRegistration.spec.ts | New E2E test file covering link card, replace card, and error scenarios for visa card management |
| e2e/portal/pages/RegistrationDebitCardPage.ts | Added helper methods for interacting with link/replace card functionality in E2E tests |
AB#39420
Describe your changes
Note:
The "Error when linking non existing card" unfortunately cannot be tested at this point because we cannot mock non existing cards.
Checklist before requesting a code review
Portal preview-deployment
https://happy-rock-0411d2003-7681.westeurope.3.azurestaticapps.net