From d62740da109568a2db33aea643e08e31addcee59 Mon Sep 17 00:00:00 2001 From: David Cook Date: Tue, 13 May 2025 14:46:11 +1000 Subject: [PATCH] Update helper to exclude line items MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit _scrolls down_ Oh... JB already did that 😆 Nice to see we were thinking along the same lines. --- spec/system/admin/bulk_order_management_spec.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/spec/system/admin/bulk_order_management_spec.rb b/spec/system/admin/bulk_order_management_spec.rb index 002910a99d..152ea1873e 100644 --- a/spec/system/admin/bulk_order_management_spec.rb +++ b/spec/system/admin/bulk_order_management_spec.rb @@ -735,10 +735,8 @@ RSpec.describe ' expect(page).to have_select2 'order_cycle_filter', with_options: OrderCycle.pluck(:name).unshift("All") expect(page).not_to have_selector "#loading i" - expect(page).to have_selector "tr#li_#{li1.id}" - expect(page).not_to have_selector "tr#li_#{li2.id}" - expect(page).not_to have_selector "tr#li_#{li3.id}" - expect(page).not_to have_selector "tr#li_#{li4.id}" + + expect_line_items(li1, excluding: [li2, li3, li3a, li4]) end it "displays all line items when 'All' is selected from order_cycle filter", retry: 3 do @@ -1309,10 +1307,13 @@ RSpec.describe ' expect(page).not_to have_text 'Loading orders' end - def expect_line_items(*line_items) + def expect_line_items(*line_items, excluding: []) line_items.each do |line_item| expect(page).to have_selector "tr#li_#{line_item.id}" end + excluding.each do |line_item| + expect(page).not_to have_selector "tr#li_#{line_item.id}" + end end def expect_line_items_results(line_items, excluded_line_items)