mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-11 23:17:48 +00:00
Name symbols on quantity buttons in specs
This commit is contained in:
@@ -311,7 +311,7 @@ feature "As a consumer I want to shop with a distributor", js: true do
|
||||
|
||||
within_variant(variant) do
|
||||
expect(page).to have_content "5 in cart"
|
||||
expect(page).to have_button "+", disabled: true
|
||||
expect(page).to have_button increase_quantity_symbol, disabled: true
|
||||
end
|
||||
end
|
||||
|
||||
@@ -364,7 +364,7 @@ feature "As a consumer I want to shop with a distributor", js: true do
|
||||
|
||||
# -- Messaging
|
||||
within(".reveal-modal") do
|
||||
page.all("button", text: "+").last.click
|
||||
page.all("button", text: increase_quantity_symbol).last.click
|
||||
end
|
||||
close_modal
|
||||
wait_for_cart
|
||||
|
||||
@@ -47,14 +47,14 @@ module ShopWorkflow
|
||||
def click_add_to_cart(variant = nil, quantity = 1)
|
||||
within_variant(variant) do
|
||||
click_button "Add"
|
||||
(quantity - 1).times { click_button "+" }
|
||||
(quantity - 1).times { click_button increase_quantity_symbol }
|
||||
end
|
||||
wait_for_cart
|
||||
end
|
||||
|
||||
def click_remove_from_cart(variant = nil, quantity = 1)
|
||||
within_variant(variant) do
|
||||
quantity.times { click_button "-" }
|
||||
quantity.times { click_button decrease_quantity_symbol }
|
||||
end
|
||||
wait_for_cart
|
||||
end
|
||||
@@ -65,7 +65,7 @@ module ShopWorkflow
|
||||
end
|
||||
within(".reveal-modal") do
|
||||
(quantity - 1).times do
|
||||
first(:button, "+").click
|
||||
first(:button, increase_quantity_symbol).click
|
||||
end
|
||||
end
|
||||
wait_for_cart
|
||||
@@ -74,7 +74,7 @@ module ShopWorkflow
|
||||
def click_add_bulk_max_to_cart(variant = nil, quantity = 1)
|
||||
within(".reveal-modal") do
|
||||
quantity.times do
|
||||
page.all("button", text: "+").last.click
|
||||
page.all("button", text: increase_quantity_symbol).last.click
|
||||
end
|
||||
end
|
||||
wait_for_cart
|
||||
@@ -94,6 +94,14 @@ module ShopWorkflow
|
||||
end
|
||||
end
|
||||
|
||||
def increase_quantity_symbol
|
||||
"+"
|
||||
end
|
||||
|
||||
def decrease_quantity_symbol
|
||||
"-"
|
||||
end
|
||||
|
||||
def toggle_accordion(name)
|
||||
find("dd a", text: name).click
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user