From 738bf85284f932fdc5b3ae87d87df341d018c79f 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 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/spec/system/admin/enterprises_spec.rb b/spec/system/admin/enterprises_spec.rb index 995b15ae0c1..e3c4d535476 100644 --- a/spec/system/admin/enterprises_spec.rb +++ b/spec/system/admin/enterprises_spec.rb @@ -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]" @@ -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