From 67dc79b074f47811850ff39d8263f50b96cd72ac Mon Sep 17 00:00:00 2001 From: Gaetan Craig-Riou Date: Wed, 24 Jan 2024 14:53:44 +1100 Subject: [PATCH] Replace tomselect_search_and_select by tomselect_select In these scenarios, searching for the option is not actually required, we can directly click on the needed option. It prevent issue with the dropdown option staying open and breaking specs. --- spec/system/admin/orders_spec.rb | 4 ++-- spec/system/admin/subscriptions/crud_spec.rb | 2 +- spec/system/admin/subscriptions/smoke_tests_spec.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/system/admin/orders_spec.rb b/spec/system/admin/orders_spec.rb index 41858b9e1e..b9f29d296b 100644 --- a/spec/system/admin/orders_spec.rb +++ b/spec/system/admin/orders_spec.rb @@ -934,8 +934,8 @@ describe ' fill_in "Order number", with: "R123456" tomselect_multiselect order_cycle.name, from: 'q[order_cycle_id_in][]' tomselect_multiselect distributor.name, from: 'q[distributor_id_in][]' - tomselect_search_and_select shipping_method.name, from: 'shipping_method_id' - tomselect_search_and_select "complete", from: 'q[state_eq]' + tomselect_select shipping_method.name, from: 'shipping_method_id' + tomselect_select "complete", from: 'q[state_eq]' fill_in "Email", with: user.email fill_in "First name begins with", with: "J" fill_in "Last name begins with", with: "D" diff --git a/spec/system/admin/subscriptions/crud_spec.rb b/spec/system/admin/subscriptions/crud_spec.rb index 274ecf823d..cb4c901639 100644 --- a/spec/system/admin/subscriptions/crud_spec.rb +++ b/spec/system/admin/subscriptions/crud_spec.rb @@ -233,7 +233,7 @@ describe 'Subscriptions' do before do visit admin_subscriptions_path page.find("#new-subscription").click - tomselect_search_and_select shop.name, from: "subscription[shop_id]" + tomselect_select shop.name, from: "subscription[shop_id]" click_button "Continue" end diff --git a/spec/system/admin/subscriptions/smoke_tests_spec.rb b/spec/system/admin/subscriptions/smoke_tests_spec.rb index cfd1e7a2a4..86ab504a4b 100644 --- a/spec/system/admin/subscriptions/smoke_tests_spec.rb +++ b/spec/system/admin/subscriptions/smoke_tests_spec.rb @@ -183,7 +183,7 @@ describe 'Subscriptions' do before do visit admin_subscriptions_path page.find("#new-subscription").click - tomselect_search_and_select shop.name, from: "subscription[shop_id]" + tomselect_select shop.name, from: "subscription[shop_id]" click_button "Continue" end