Permalink
Browse files

Filterable: Test filterReveal show all upon all matching filter

  • Loading branch information...
gabrielschulhof committed Apr 10, 2014
1 parent f2ca4b7 commit db17abf28538f6fb2535be258da9538c7f336f9f
Showing with 23 additions and 1 deletion.
  1. +15 −0 tests/unit/filterable/filterable_core.js
  2. +8 −1 tests/unit/filterable/index.html
@@ -27,4 +27,19 @@ test( "Filterable input prevents default on ENTER", function() {
deepEqual( event.isDefaultPrevented(), true, "Subsequent keypress default is also prevented" );
});
asyncTest( "filterReveal filterable shows all items when all items match filter text", function() {
var input = $( "#test-filter-reveal-show-all-input" ),
list = $( "#test-filter-reveal-show-all-list" );
expect( 1 );
input.val( "Test" ).trigger( "change" );
setTimeout( function() {
deepEqual( list.children( ".ui-screen-hidden" ).length, 0,
"All items visible when search value matches them all" );
start();
}, 500 );
});
})( jQuery );
@@ -57,8 +57,15 @@
<li>California</li>
<li>Oregon</li>
</ul>
<form id="test-filter-reveal-show-all-form">
<input id="test-filter-reveal-show-all-input">
</form>
<ul data-nstest-filter="true" data-nstest-filter-reveal="true" id="test-filter-reveal-show-all-list" data-nstest-input="#test-filter-reveal-show-all-input">
<li>Test 1</li>
<li>Test 2</li>
<li>Test 3</li>
</ul>
</div>
</div>
</body>
</html>

0 comments on commit db17abf

Please sign in to comment.