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

EL-1725 EE back button #1594

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

EL-1725 EE back button #1594

wants to merge 5 commits into from

Conversation

willc-work
Copy link
Contributor

Jira ticket

What changed and why

change back button behaviour from results page when they arrive there from an ee result.

Guidance to review

Checklist

Before you ask people to review this PR:

  • Tests and rubocop should be passing
  • Branch is generally up to date with main Github - definitely no conflicts
  • No unnecessary whitespace changes. These make diffs harder to read and conflicts more likely.
  • PR description says what changed and why, with a link to the JIRA story.
  • Diff has been checked for unexpected changes being included.
  • Commit messages say why the change was made.

@willc-work willc-work force-pushed the EL-1725-back-2-the-feeature branch 2 times, most recently from 8bfe537 to cb91270 Compare October 11, 2024 14:40
@willc-work willc-work changed the title handle back button from the results page EL-1725 EE back button Oct 11, 2024
@willc-work willc-work marked this pull request as ready for review October 14, 2024 16:46
@willc-work willc-work requested a review from a team as a code owner October 14, 2024 16:46
Copy link
Contributor

@HettieS HettieS left a comment

Choose a reason for hiding this comment

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

Approved but would love to see if we can add another test to really verify the back button goes to the right place

@@ -5,7 +5,10 @@
= t(@check.controlled? ? ".controlled_qualifies" : ".likely_to_qualify")

- content_for :back do
= link_to t("generic.back"), check_answers_path(assessment_code: params[:assessment_code]), class: "govuk-back-link"
- if FeatureFlags.enabled?(:ee_banner, @check.session_data) && @early_result_type == "gross_income"
Copy link
Contributor

Choose a reason for hiding this comment

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

looks good - might not be necessary at the min but to future proof this for other early result type checks, you could just check for the presence of early_result_type (rather than tying it to gross_income specifically), as the behaviour of going back to the previous step should be the same for all early results

Copy link
Contributor

Choose a reason for hiding this comment

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

and early_result_type should only exist if they never saw 'Check Answers' (the place where we clear it out from the session)

Copy link
Contributor

Choose a reason for hiding this comment

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

ooooh actually it's wouldn't exist for short checks e.g. passported! So maybe this is the best way for now, or maybe the condition is check for early result and check it isn't a 'short check'...will leave to you!

click_on "Go to results page"
expect(page).to have_current_path(/\A\/check-result/)
expect(page).to have_content "Your client's key eligibility totals"
visit outgoings_url # simulates using the back button to return to outgoings
Copy link
Contributor

Choose a reason for hiding this comment

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

I see why you've done this - I wonder if we can add a test that really checks the back button is working as expected? Perhaps an end2end test might work? But not too sure

@HettieS HettieS added question Further information is requested Approved and removed Ready For Review labels Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved question Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants