mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-04 02:31:33 +00:00
Add reliable way to check if cart is dirty. Previous way returned true when cart empty.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
%span.cart-span{"ng-controller" => "CartCtrl", "ng-class" => "{ dirty: Cart.dirty || Cart.empty() }"}
|
||||
%span.cart-span{"ng-controller" => "CartCtrl", "ng-class" => "{ dirty: Cart.dirty || Cart.empty(), 'pure-dirty': Cart.dirty }"}
|
||||
%a#cart.icon{cart: true}
|
||||
%span.nav-branded
|
||||
%i.ofn-i_027-shopping-cart
|
||||
|
||||
@@ -36,7 +36,7 @@ module UIComponentHelper
|
||||
end
|
||||
|
||||
def have_login_modal
|
||||
have_selector ".login-modal"
|
||||
have_selector ".login-modal"
|
||||
end
|
||||
|
||||
def open_product_modal(product)
|
||||
@@ -69,7 +69,7 @@ module UIComponentHelper
|
||||
end
|
||||
|
||||
def cart_dirty
|
||||
page.find("span.cart-span")[:class].include? 'dirty'
|
||||
page.find("span.cart-span")[:class].include? 'pure-dirty'
|
||||
end
|
||||
|
||||
def wait_for_ajax
|
||||
@@ -100,7 +100,7 @@ module UIComponentHelper
|
||||
def expand_active_table_node(name)
|
||||
find(".active_table_node", text: name).click
|
||||
end
|
||||
|
||||
|
||||
def follow_active_table_node(name)
|
||||
expand_active_table_node(name)
|
||||
find(".active_table_node a", text: "#{name}").click
|
||||
|
||||
Reference in New Issue
Block a user