mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Merge pull request #13374 from filipefurtad0/unit_price_checks
Adds Unit price checks
This commit is contained in:
@@ -48,7 +48,7 @@ RSpec.describe '
|
||||
end
|
||||
end
|
||||
|
||||
describe "when admin use es as default language (and comma as decimal separator)", :debug do
|
||||
describe "when admin use es as default language (and comma as decimal separator)" do
|
||||
it "creating a new product with a comma separated decimal price" do
|
||||
login_as_admin
|
||||
visit spree.admin_dashboard_path(locale: 'es')
|
||||
|
||||
@@ -170,7 +170,9 @@ RSpec.describe "Order Management" do
|
||||
expect(page).to have_button 'Save Changes'
|
||||
|
||||
expect(find("tr.variant-#{item2.variant.id}")).to have_content item2.product.name
|
||||
expect(find("tr.variant-#{item2.variant.id}")).to have_content("$10,000.00 / kg")
|
||||
expect(find("tr.variant-#{item3.variant.id}")).to have_content item3.product.name
|
||||
expect(find("tr.variant-#{item3.variant.id}")).to have_content("$10,000.00 / kg")
|
||||
expect(find("tr.order-adjustment")).to have_content "Shipping"
|
||||
expect(find("tr.order-adjustment")).to have_content "5.00"
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ RSpec.describe "As a consumer, I want to check unit price information for a prod
|
||||
expect(page).to have_selector '.variant-unit-price'
|
||||
within '.variant-unit-price' do
|
||||
expect(page).to have_selector '.question-mark-icon'
|
||||
expect(page).to have_content("$19,990.00 / kg") # displays the unit price value
|
||||
end
|
||||
find('.question-mark-icon').click
|
||||
expect(page).to have_selector '.joyride-tip-guide.question-mark-tooltip'
|
||||
@@ -62,7 +63,10 @@ RSpec.describe "As a consumer, I want to check unit price information for a prod
|
||||
|
||||
it "shows/hide the unit price information with the question mark icon in the sidebar" do
|
||||
expect(page).to have_selector ".cart-content .question-mark-icon"
|
||||
find(".cart-content .question-mark-icon").click
|
||||
within ".cart-content" do
|
||||
expect(page).to have_content("$19,990.00 / kg") # displays the unit price value
|
||||
find(".question-mark-icon").click
|
||||
end
|
||||
expect(page).to have_selector '.joyride-tip-guide.question-mark-tooltip'
|
||||
within '.joyride-tip-guide.question-mark-tooltip' do
|
||||
expect(page).to have_content('This is the unit price of this product. ' \
|
||||
@@ -74,6 +78,8 @@ RSpec.describe "As a consumer, I want to check unit price information for a prod
|
||||
expect(page).not_to have_content('This is the unit price of this product. ' \
|
||||
'It allows you to compare the price of products ' \
|
||||
'independent of packaging sizes & weights.')
|
||||
|
||||
expect(page).to have_content("$19,990.00 / kg")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user