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 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion app/views/results/show.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -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
= back_link(@previous_step, true)
-else
= link_to t("generic.back"), check_answers_path(assessment_code: params[:assessment_code]), class: "govuk-back-link"

.govuk-grid-column-full
= render "shared/heading"
Expand Down
12 changes: 12 additions & 0 deletions spec/flows/early_result_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,18 @@
expect(page).to have_content "Your client's key eligibility totals"
end

it "when I go straight to results and use the back button it shows the banner" do
confirm_screen("outgoings")
outgoings_url = current_path
expect(page).to have_content("Gross monthly income limit exceeded")
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
willc-work marked this conversation as resolved.
Show resolved Hide resolved
expect(page).to have_content("Gross monthly income limit exceeded by")
expect(page).to have_content("Go to results page")
end

context "when the early eligibility changes" do
it "back links and banner work as expected" do
confirm_screen("outgoings")
Expand Down