diff --git a/spec/system/consumer/shopping/variant_overrides_spec.rb b/spec/system/consumer/shopping/variant_overrides_spec.rb index 9ae0b5dd21..5fbb24de3e 100644 --- a/spec/system/consumer/shopping/variant_overrides_spec.rb +++ b/spec/system/consumer/shopping/variant_overrides_spec.rb @@ -102,6 +102,24 @@ describe "shopping with variant overrides defined", js: true do expect(page).to have_price with_currency(61.11) end + context "clicking the pie-chart icon" do + before do + visit shop_path + within "#variant-#{product1_variant1.id}" do + page.find(".graph-button").click + end + end + + it "shows the price breakdown modal" do + within(:xpath, '//body') do + within(".price_breakdown") do + expect(page).to have_content("Price breakdown") + expect(page).to have_content(enterprise_fee.name.to_s) + end + end + end + end + # The two specs below reveal an unrelated issue with fee calculation. See: # https://github.com/openfoodfoundation/openfoodnetwork/issues/312