From 870e2b447c67ad833c1119ed75a66ee1daecbe77 Mon Sep 17 00:00:00 2001 From: Ahmed Ejaz Date: Fri, 5 Apr 2024 23:49:52 +0500 Subject: [PATCH] 12294 - add specs - display none if no tax category is selected - add a tax_category_column css selector for future related specs --- spec/system/admin/products_v3/products_spec.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spec/system/admin/products_v3/products_spec.rb b/spec/system/admin/products_v3/products_spec.rb index df24a79483..1756230ef1 100644 --- a/spec/system/admin/products_v3/products_spec.rb +++ b/spec/system/admin/products_v3/products_spec.rb @@ -485,6 +485,7 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do expect(new_variant.price).to eq 10.25 expect(new_variant.unit_value).to eq 1000 expect(new_variant.on_hand).to eq 3 + expect(new_variant.tax_category_id).to be_nil within row_containing_name("Large box") do expect(page).to have_field "Name", with: "Large box" @@ -492,6 +493,9 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do expect(page).to have_field "Price", with: "10.25" expect(page).to have_content "1kg" expect(page).to have_button "On Hand", text: "3" + within tax_category_column do + expect(page).to have_content "None" + end end end @@ -962,4 +966,8 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do def expect_page_to_have_image(url) expect(page).to have_selector("img[src$='#{url}']") end + + def tax_category_column + @tax_category_column ||= 'td:nth-child(10)' + end end