Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Commit db17abf

Browse files
author
Gabriel Schulhof
committed
Filterable: Test filterReveal show all upon all matching filter
1 parent f2ca4b7 commit db17abf

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

tests/unit/filterable/filterable_core.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,19 @@ test( "Filterable input prevents default on ENTER", function() {
2727
deepEqual( event.isDefaultPrevented(), true, "Subsequent keypress default is also prevented" );
2828
});
2929

30+
asyncTest( "filterReveal filterable shows all items when all items match filter text", function() {
31+
var input = $( "#test-filter-reveal-show-all-input" ),
32+
list = $( "#test-filter-reveal-show-all-list" );
33+
34+
expect( 1 );
35+
36+
input.val( "Test" ).trigger( "change" );
37+
38+
setTimeout( function() {
39+
deepEqual( list.children( ".ui-screen-hidden" ).length, 0,
40+
"All items visible when search value matches them all" );
41+
start();
42+
}, 500 );
43+
});
44+
3045
})( jQuery );

tests/unit/filterable/index.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,15 @@
5757
<li>California</li>
5858
<li>Oregon</li>
5959
</ul>
60+
<form id="test-filter-reveal-show-all-form">
61+
<input id="test-filter-reveal-show-all-input">
62+
</form>
63+
<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">
64+
<li>Test 1</li>
65+
<li>Test 2</li>
66+
<li>Test 3</li>
67+
</ul>
6068
</div>
6169
</div>
62-
6370
</body>
6471
</html>

0 commit comments

Comments
 (0)