From 81d35741a1bd7d7824ea95f078c5ecbba723d12b Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Mon, 5 May 2025 19:50:32 +0100 Subject: [PATCH] Adds tests to toggle the css sections It's a lucky guess, but the idea is that pre-loading the CSS sections and its contents makes it slightly faster, for following assertions, which are the flaky offenders --- spec/system/admin/order_cycles/simple_spec.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spec/system/admin/order_cycles/simple_spec.rb b/spec/system/admin/order_cycles/simple_spec.rb index 6fef56e540..36bb02a9a9 100644 --- a/spec/system/admin/order_cycles/simple_spec.rb +++ b/spec/system/admin/order_cycles/simple_spec.rb @@ -555,6 +555,14 @@ RSpec.describe ' expect(page).to have_selector "tr.distributor-#{distributor_permitted.id}" expect(page).to have_selector 'tr.distributor', count: 2 + # Toggling all products displays the css section of the distributed products + click_link "Expand all" + expect(page).to have_css ".exchange-distributed-products", count: 2 + + # Colapsing all products hides the css section of the distributed products + click_link "Collapse all" + expect(page).not_to have_css ".exchange-distributed-products" + # Open the products list for managed_supplier's incoming exchange within "tr.distributor-#{distributor_managed.id}" do page.find("td.products").click