Skip to content

Conversation

@Piotrk39
Copy link
Contributor

@Piotrk39 Piotrk39 commented Dec 22, 2025

AB#39420

Describe your changes

  • Fixes tests from 'ManageDebitCards' suite
  • Adds new E2E tests for 'Linking Visa Card with Registration':
    • Succesfully linking a card to a registration
    • Succesfully replacing a card for a registration
    • Error when linking already linked card

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

  • I have performed a self-review of my code
  • I have addressed all Copilot comments
  • The changes do not touch the UI/UX
  • I have added tests for my changes
  • I have made sure that all automated checks pass before requesting a review
  • I do not need any deviation from our PR guidelines

Portal preview-deployment

https://happy-rock-0411d2003-7681.westeurope.3.azurestaticapps.net

@Piotrk39 Piotrk39 added the chore Something that does not affect the end user label Dec 22, 2025
@Piotrk39 Piotrk39 force-pushed the Piotrk39/test.add-e2e-tests-for-link-visa-card-registration branch from 64c6929 to 697c6b8 Compare December 29, 2025 10:10
Copy link
Contributor

Copilot AI left a 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

@Piotrk39 Piotrk39 changed the base branch from yuri/link-visa-card-with-registration-front-end to arsforza/fix/link-visa-card-frontend December 30, 2025 10:55
@Piotrk39 Piotrk39 requested a review from arsforza December 30, 2025 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Something that does not affect the end user

Development

Successfully merging this pull request may close these issues.

2 participants