From 3ddc08cbcc02c264db3c62b5ca58d5ce6a4985cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Turbelin?= Date: Thu, 26 Dec 2024 18:28:35 +0100 Subject: [PATCH] Do explicit save in specs when switching tabs --- spec/system/admin/enterprises_spec.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/spec/system/admin/enterprises_spec.rb b/spec/system/admin/enterprises_spec.rb index 995b15ae0c1..6861dc9e6a2 100644 --- a/spec/system/admin/enterprises_spec.rb +++ b/spec/system/admin/enterprises_spec.rb @@ -122,33 +122,33 @@ # 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]" expect(page).to have_selector "[data-test=link_for_shipping_methods]" - accept_alert { click_link "Admin Only" } choose 'Any' 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