Skip to content

Commit

Permalink
Do explicit save in specs when switching tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
pacodelaluna committed Dec 26, 2024
1 parent 5cd50b1 commit 738bf85
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions spec/system/admin/enterprises_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,22 +122,23 @@
# Unchecking hides the Properties tab
accept_alert { click_link "Primary Details" }
uncheck 'enterprise_is_primary_producer'
accept_alert { click_link "Admin Only" }
click_button 'Update'
click_link "Admin Only"
choose 'None'
expect(page).not_to have_selector "[data-test=link_for_enterprise_fees]"
expect(page).not_to have_selector "[data-test=link_for_payment_methods]"
expect(page).not_to have_selector "[data-test=link_for_shipping_methods]"
expect(page).not_to have_selector "[data-test=link_for_properties]"
click_button 'Update'
# Checking displays the Properties tab
accept_alert { click_link "Primary Details" }
check 'enterprise_is_primary_producer'
expect(page).to have_selector "[data-test=link_for_enterprise_fees]"
expect(page).not_to have_selector "[data-test=link_for_payment_methods]"
expect(page).not_to have_selector "[data-test=link_for_shipping_methods]"
expect(page).to have_selector "[data-test=link_for_properties]"
accept_alert { click_link "Primary Details" }
uncheck 'enterprise_is_primary_producer'
accept_alert { click_link "Admin Only" }
click_button 'Update'
click_link "Admin Only"
choose 'Own'
expect(page).to have_selector "[data-test=link_for_enterprise_fees]"
expect(page).to have_selector "[data-test=link_for_payment_methods]"
Expand All @@ -147,8 +148,8 @@
expect(page).to have_selector "[data-test=link_for_enterprise_fees]"
expect(page).to have_selector "[data-test=link_for_payment_methods]"
expect(page).to have_selector "[data-test=link_for_shipping_methods]"
click_button 'Update'

accept_alert { click_link "Primary Details" }
page.find("#enterprise_group_ids-ts-control").set(eg1.name)
page.find("#enterprise_group_ids-ts-dropdown .option.active").click

Expand Down

0 comments on commit 738bf85

Please sign in to comment.