From c37564eea7982755c0176b827fe3f4e477aa830c Mon Sep 17 00:00:00 2001 From: cyrillefr Date: Tue, 7 Feb 2023 15:49:56 +0100 Subject: [PATCH] Modify spec for orders bulk cancelling --- spec/system/admin/bulk_order_cancellation_spec.rb | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/spec/system/admin/bulk_order_cancellation_spec.rb b/spec/system/admin/bulk_order_cancellation_spec.rb index de9489b72b..6867bf7ba5 100644 --- a/spec/system/admin/bulk_order_cancellation_spec.rb +++ b/spec/system/admin/bulk_order_cancellation_spec.rb @@ -29,15 +29,20 @@ describe ' expect(page).to have_selector('span', text: 'COMPLETE', count: 2) page.check('selectAll') - page.find('.ofn-drop-down').click - page.find('.menu').find('span', text: 'Cancel Orders').click + page.find("span.icon-reorder", text: "ACTIONS").click + within ".ofn-drop-down-with-prepend .menu" do + page.find("span", text: "Cancel Orders").click + end - within '.modal' do - click_on "OK" + within '.reveal-modal' do + expect { + find_button("Confirm").click + }.to change { o1.reload.state }.from('complete').to('canceled') + .and change { o2.reload.state }.from('complete').to('canceled') end # Verify that the orders have a STATE of CANCELLED - expect(page).to have_selector('span', text: 'CANCELLED', count: 2) + expect(page).to have_selector('span.canceled', text: 'CANCELLED', count: 2) end end end