Skip to content

Commit

Permalink
Merge pull request openfoodfoundation#11972 from filipefurtad0/fix_fl…
Browse files Browse the repository at this point in the history
…aky_enterprise_navigation

Moves test introduced by openfoodfoundation#11799 to avoid non-explicit modal acceptance
  • Loading branch information
mkllnk authored Jan 3, 2024
2 parents b9f117e + 2e301a6 commit 1746ba5
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 1746ba5

Please sign in to comment.