Permalink
Browse files

Revert "Test for issue #4133"

This reverts commit ab94466.

Signed-off-by: levidehaan <levi@dehaandev.com>
  • Loading branch information...
1 parent ab94466 commit 012eaec45da9e574d7321a57b99540774fe92ed7 levidehaan committed Aug 9, 2012
Showing with 31 additions and 106 deletions.
  1. +0 −15 tests/unit/listview/index.html
  2. +31 −91 tests/unit/listview/listview_core.js
@@ -281,21 +281,6 @@ <h2 id="qunit-userAgent"></h2>
</div>
</div>
-<!-- Search bar filter -->
-<div data-nstest-role="page" id='search-customfilter-test'>
- <div data-nstest-role="header" data-nstest-position="inline">
- <h1>Filtered List View</h1>
- </div>
- <div data-nstest-role="content">
- <ul data-nstest-role="listview" data-nstest-filter="true">
- <li>a is for aquaman</li>
- <li>b is for batman</li>
- <li>c is for catwoman</li>
- <li>d is for darkwing</li>
- </ul>
- </div>
-</div>
-
<!-- Search bar filter with list-dividers -->
<div data-nstest-role="page" id='search-filter-with-dividers-test'>
<div data-nstest-role="header" data-nstest-position="inline">
@@ -417,10 +417,11 @@
]);
});
- module( "Search Filter" );
+ module( "Search Filter");
var searchFilterId = "#search-filter-test";
+
asyncTest( "Filter downs results when the user enters information", function() {
var $searchPage = $(searchFilterId);
$.testHelper.pageSequence([
@@ -594,96 +595,6 @@
]);
});
- module( "Custom search filter", {
- setup: function() {
- var self = this;
- this._refreshCornersCount = 0;
- this._refreshCornersFn = $.mobile.listview.prototype._refreshCorners;
-
- this.startTest = function() {
- return this._refreshCornersCount === 1;
- };
-
- // _refreshCorners is the last method called in the filter loop
- // so we count the number of times _refreshCorners gets invoked to stop the test
- $.mobile.listview.prototype._refreshCorners = function() {
- self._refreshCornersCount += 1;
- self._refreshCornersFn.apply( this, arguments );
- if ( self.startTest() ) {
- start();
- }
- }
- },
- teardown: function() {
- $.mobile.listview.prototype._refreshCorners = this._refreshCornersFn;
- }
- });
-
- asyncTest( "Custom filterCallback should cause iteration on all list elements", function(){
- var listPage = $( "#search-customfilter-test" ),
- filterCallbackCount = 0,
- expectedCount = 2 * listPage.find("li").length;
- expect( 1 );
-
- this.startTest = function() {
- if ( this._refreshCornersCount === 3 ) {
- equal( filterCallbackCount, expectedCount, "filterCallback should be call exactly "+ expectedCount +" times" );
- }
- return this._refreshCornersCount === 3;
- }
-
- $.testHelper.pageSequence( [
- function(){
- //reset for relative url refs
- $.mobile.changePage( home );
- },
-
- function() {
- $.mobile.changePage( "#search-customfilter-test" );
- },
-
- function() {
- // set the listview instance callback
- listPage.find( "ul" ).listview( "option", "filterCallback", function( text, searchValue, item ) {
- filterCallbackCount += 1;
-
- return text.toString().toLowerCase().indexOf( searchValue ) === -1;
- });
-
- // trigger a change in the search filter
- listPage.find( "input" ).val( "at" ).trigger( "change" );
- listPage.find( "input" ).val( "atw" ).trigger( "change" );
-
- }
- ]);
- });
-
- asyncTest( "filterCallback can be altered after widget creation", function(){
- var listPage = $( "#search-customfilter-test" );
- expect( listPage.find("li").length );
-
- $.testHelper.pageSequence( [
- function(){
- //reset for relative url refs
- $.mobile.changePage( home );
- },
-
- function() {
- $.mobile.changePage( "#search-customfilter-test" );
- },
-
- function() {
- // set the listview instance callback
- listPage.find( "ul" ).listview( "option", "filterCallback", function() {
- ok( true, "custom callback invoked" );
- });
-
- // trigger a change in the search filter
- listPage.find( "input" ).val( "foo" ).trigger( "change" );
- }
- ]);
- });
-
module( "Programmatically generated list items", {
setup: function(){
var item,
@@ -881,6 +792,35 @@
]);
});
+ asyncTest( "filterCallback can be altered after widget creation", function(){
+ var listPage = $( "#search-filter-test" );
+ expect( listPage.find("li").length );
+
+ $.testHelper.pageSequence( [
+ function(){
+ //reset for relative url refs
+ $.mobile.changePage( home );
+ },
+
+ function() {
+ $.mobile.changePage( "#search-filter-test" );
+ },
+
+ function() {
+ // set the listview instance callback
+ listPage.find( "ul" ).listview( "option", "filterCallback", function() {
+ ok(true, "custom callback invoked");
+ });
+
+ // trigger a change in the search filter
+ listPage.find( "input" ).val( "foo" ).trigger( "change" );
+
+ //NOTE beware a poossible issue with timing here
+ start();
+ }
+ ]);
+ });
+
asyncTest( "nested pages hash key is always in the hash (replaceState)", function(){
$.testHelper.pageSequence([
function(){

0 comments on commit 012eaec

Please sign in to comment.