Skip to content

Commit

Permalink
add test for banner on return to outgoings
Browse files Browse the repository at this point in the history
  • Loading branch information
willc-work committed Oct 14, 2024
1 parent b4c7aa2 commit 891349e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 18 deletions.
6 changes: 0 additions & 6 deletions app/controllers/results_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ def early_result_redirect
def show
# ee_banner @early_eligibility_selection can be removed when FF is removed
@early_result_type = session_data.dig("early_result", "type")

# Testing back button spec
# pp @early_result_type
# puts FeatureFlags.enabled?(:ee_banner, session_data)
# pp session_data

@early_eligibility_selection = session_data.fetch("early_eligibility_selection", nil)
@model = CalculationResult.new(session_data)
# we'll need to move this tracking point or do something with it
Expand Down
23 changes: 11 additions & 12 deletions spec/flows/early_result_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,18 +109,17 @@
expect(page).to have_content "Your client's key eligibility totals"
end

# Something must be missing in the session data because the back button sends us to the start page
# in the test but not on the actual service.
# however the early_result and feature flag session data is available
# it "when I go straight to results and use the back button it shows the banner" do
# confirm_screen("outgoings")
# 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"
# click_on "Back"
# expect(page).to have_content("Gross monthly income limit exceeded by")
# 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
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
Expand Down

0 comments on commit 891349e

Please sign in to comment.