From 2a61adc6b095a8521872777126d966f8a2d334f9 Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Tue, 16 Jan 2024 12:48:22 +0100 Subject: [PATCH] fix(admin stock items spec): Wait for tab to be active --- admin/spec/features/stock_items_spec.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/admin/spec/features/stock_items_spec.rb b/admin/spec/features/stock_items_spec.rb index eac6abea459..ca4c430753f 100644 --- a/admin/spec/features/stock_items_spec.rb +++ b/admin/spec/features/stock_items_spec.rb @@ -36,24 +36,28 @@ expect(find('tr', text: 'MY-SKU-1234567890')).to have_content('1 stock movement') click_on 'Back Orderable' + expect(page).to have_css('[aria-current="true"]', text: 'Back Orderable') expect(page).to_not have_content(non_backorderable.variant.sku) expect(page).to have_content(backorderable.variant.sku) expect(page).to_not have_content(out_of_stock.variant.sku) expect(page).to_not have_content(low_stock.variant.sku) click_on 'Out Of Stock' + expect(page).to have_css('[aria-current="true"]', text: 'Out Of Stock') expect(page).to_not have_content(non_backorderable.variant.sku) expect(page).to_not have_content(backorderable.variant.sku) expect(page).to have_content(out_of_stock.variant.sku) expect(page).to_not have_content(low_stock.variant.sku) click_on 'Low Stock' + expect(page).to have_css('[aria-current="true"]', text: 'Low Stock') expect(page).to_not have_content(non_backorderable.variant.sku) expect(page).to_not have_content(backorderable.variant.sku) expect(page).to_not have_content(out_of_stock.variant.sku) expect(page).to have_content(low_stock.variant.sku) click_on 'In Stock' + expect(page).to have_css('[aria-current="true"]', text: 'In Stock') expect(page).to have_content(non_backorderable.variant.sku) expect(page).to have_content(backorderable.variant.sku) expect(page).to_not have_content(out_of_stock.variant.sku)