Skip to content
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

feat(EMS-4011-4022): policy - change your answers - broker address #3482

Merged
merged 21 commits into from
Jan 21, 2025

Conversation

ttbarnes
Copy link
Contributor

@ttbarnes ttbarnes commented Jan 15, 2025

Introduction ✏️

This PR updates the user flow to allow for a "change your answers" journey - for changing the "broker address" answer.

Note: the "broker details" form has 4x fields. Depending on the original/origin URL and the current data shape, different redirects need to occur. For example:

  • If the route is a "change" route and postcode or building number/ name has not changed, redirect to "Check your answers" URL.
  • If the route is a "change" route and postcode or building number/ name has changed, redirect to the "broker addreses" URL.

Resolution ✔️

E2E

  • UpdatecheckPolicySummaryList address fields to accept shouldRender and expectedValue params.
  • Update constants.
  • Add test coverage for:
    • When a broker is being used and is based in the UK, changing the "address" to not be based in the UK.
    • When a broker is being used and is not based in the UK, changing the "address" to be based in the UK - multiple addresses available to choose from.
    • When a broker is being used and is not based in the UK, changing the "address" to be based in the UK - single address available.
    • Changing "using broker" from no to yes, and then completing the forms with the broker being based in the UK.
    • Changing "using broker" from no to yes, and then completing the forms with the broker not being based in the UK.

UI

  • Add BROKER_CONFIRM_ADDRESS "change" and "check and change" routes.
  • Update the BROKER_CONFIRM_ADDRESS controller to:
    • Have pageVariables return a USE_DIFFERENT_ADDRESS_URL with or without a "change" suffix.
    • Redirect to CHECK_YOUR_ANSWERS if the original URL is a "change" URL.
  • Update and Refactor the BROKER_DETAILS controller's POST redirection into it's own helper:
    • getBrokerDetailsPostRedirectUrl
    • basedInUkRedirectUrl
    • notBasedInUkRedirectUrl
  • Update the policy summary list mapping so that:
    • The BROKER_MANUAL_ADDRESS field links to BROKER_CONFIRM_ADDRESS, instead of BROKER_MANUAL_ADDRESS.
    • The SELECT_THE_ADDRESS field's call to generateMultipleFieldHtml only consumes the existing addressLine1 value. Otherwise, it is incorrect.

Miscellaneous ➕

  • Update BROKER_FULL_ADDRESS mocks, to be clearer.
  • Align some E2E test descriptions.
  • Remove some unnecessary usingBroker params being passed to cy.completeAndSubmitBrokerDetailsForm.
  • Remove some unnecessary comments.
  • Minor documentation improvements.
  • Address some TODO comments

@ttbarnes ttbarnes added documentation Improvements or additions to documentation enhancement New feature or request feature New functionality tech Technical debt/improvements chore Chore labels Jan 15, 2025
@ttbarnes ttbarnes self-assigned this Jan 15, 2025
Copy link
Collaborator

@abhi-markan abhi-markan left a comment

Choose a reason for hiding this comment

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

LGTM 👍🏼

@ttbarnes ttbarnes merged commit 08883af into main-broker-address-lookup Jan 21, 2025
187 of 188 checks passed
@ttbarnes ttbarnes deleted the feat/EMS-4011-4120 branch January 21, 2025 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Chore documentation Improvements or additions to documentation enhancement New feature or request feature New functionality tech Technical debt/improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants