Add guard for selector overflow (only seen in phantom, not selenium/firefox or dev server/chrome)

This commit is contained in:
Rohan Mitchell
2016-07-07 10:04:11 +10:00
parent 1257ee09f2
commit 13cf5d29de
2 changed files with 19 additions and 1 deletions

View File

@@ -38,7 +38,8 @@ Darkswarm.directive 'singleLineSelectors', ($timeout, $filter) ->
loadWidths = ->
$(element).find("li").not(".more").each (i) ->
scope.allSelectors[i].width = $(this).outerWidth(true)
if i < scope.allSelectors.length
scope.allSelectors[i].width = $(this).outerWidth(true)
return null # So we don't exit the loop weirdly
scope.overFlowSelectors = ->

View File

@@ -55,6 +55,23 @@ feature %q{
page.should_not have_content producer2.name
end
describe "filtering by product property" do
it "filters" do
toggle_filters
toggle_filter 'Organic'
page.should have_content producer1.name
page.should_not have_content producer2.name
toggle_filter 'Organic'
toggle_filter 'Biodynamic'
page.should_not have_content producer1.name
page.should have_content producer2.name
end
end
it "shows all producers with expandable details" do
page.should have_content producer1.name
expand_active_table_node producer1.name