Skip to content

Commit

Permalink
Moves test introduced by openfoodfoundation#11799 to a section in the…
Browse files Browse the repository at this point in the history
… spec where a modal does not need acceptance

Tests forward navigation
  • Loading branch information
filipefurtad0 committed Dec 22, 2023
1 parent 5f7760c commit 2e301a6
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions spec/system/admin/enterprises_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
# expect(page).to have_checked_field "enterprise_enable_subscriptions_false"

accept_alert do
scroll_to(:bottom)
within(".side_menu") { click_link "Users" }
end
select2_select user.email, from: 'enterprise_owner_id'
Expand All @@ -120,14 +121,6 @@
click_link "Primary Details"
end

# Back navigation loads the tab content
page.execute_script('window.history.back()')
expect(page).to have_selector '#enterprise_description'

accept_alert do
click_link "Primary Details"
end

# Unchecking hides the Properties tab
uncheck 'enterprise_is_primary_producer'
choose 'None'
Expand Down Expand Up @@ -256,6 +249,14 @@
expect(page).to have_checked_field "enterprise_require_login_true"
expect(page).to have_checked_field "enterprise_enable_subscriptions_true"

# Back navigation loads the tab content
page.execute_script('window.history.back()')
expect(page).to have_selector '#enterprise_description'

# Forward navigation brings back the previous tab
page.execute_script('window.history.forward()')
expect(page).to have_content 'This is my shopfront message.'

# Test that the right input alert text is displayed
accept_alert('Please enter a URL to insert') do
first('.ta-text').click
Expand Down

0 comments on commit 2e301a6

Please sign in to comment.