Permalink
Browse files

Fixed test for "Programmatic removal of list items"

(cherry picked from commit 5d4bf2d5412c900fbcd093f1a3549a34dbab8e6c)
  • Loading branch information...
1 parent 525543b commit a6533e36766a1084e99a13314c3c802610c8a2f9 Ghislain Seguin committed Jun 17, 2011
Showing with 19 additions and 11 deletions.
  1. +19 −11 tests/unit/listview/listview_core.js
@@ -392,20 +392,28 @@
module("Programmatic list items manipulation");
- test( "Removing list items", 4, function() {
- $.testHelper.openPage("#removing-items-from-list-test");
- var ul = $('#removing-items-from-list-test ul');
- ul.find("li").first().remove();
- equal(ul.find("li").length, 3, "There should be only 3 list items left");
+ asyncTest( "Removing list items", 4, function() {
+ $.testHelper.pageSequence([
+ function(){
+ $.testHelper.openPage("#removing-items-from-list-test");
+ },
- ul.listview('refresh');
- ok(ul.find("li").first().hasClass("ui-corner-top"), "First list item should have class ui-corner-top");
+ function(){
+ var ul = $('#removing-items-from-list-test ul');
+ ul.find("li").first().remove();
+ equal(ul.find("li").length, 3, "There should be only 3 list items left");
+
+ ul.listview('refresh');
+ ok(ul.find("li").first().hasClass("ui-corner-top"), "First list item should have class ui-corner-top");
- ul.find("li").last().remove();
- equal(ul.find("li").length, 2, "There should be only 2 list items left");
+ ul.find("li").last().remove();
+ equal(ul.find("li").length, 2, "There should be only 2 list items left");
- ul.listview('refresh');
- ok(ul.find("li").last().hasClass("ui-corner-bottom"), "Last list item should have class ui-corner-bottom");
+ ul.listview('refresh');
+ ok(ul.find("li").last().hasClass("ui-corner-bottom"), "Last list item should have class ui-corner-bottom");
+ start();
+ }
+ ]);
});
})(jQuery);

0 comments on commit a6533e3

Please sign in to comment.