Add reliable way to check if cart is dirty. Previous way returned true when cart empty.

This commit is contained in:
Rohan Mitchell
2015-11-10 10:37:37 +11:00
parent d3c7c46800
commit 888e4d80ef
2 changed files with 4 additions and 4 deletions

View File

@@ -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

View File

@@ -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