Browse files

added failing test for inset listview issue with top-corner

  • Loading branch information...
1 parent 2b51355 commit dd2bdcd606e3e219ce25cc45dbde25e4e21ee829 @wietsevenema wietsevenema committed Jun 30, 2011
Showing with 38 additions and 1 deletion.
  1. +12 −0 tests/unit/listview/index.html
  2. +26 −1 tests/unit/listview/listview_core.js
View
12 tests/unit/listview/index.html
@@ -261,5 +261,17 @@ <h2 id="qunit-userAgent"></h2>
</div>
</div>
+<!-- Rounded corners inset list with variable items -->
+<div data-nstest-role="page" id='corner-rounded-test'>
+ <div data-nstest-role="header" data-nstest-position="inline">
+ <h1>Basic List View</h1>
+ </div>
+ <div data-nstest-role="content">
+ <ul data-nstest-role="listview" data-nstest-inset="true">
+ </ul>
+ </div>
+</div>
+
+
</body>
</html>
View
27 tests/unit/listview/listview_core.js
@@ -453,12 +453,37 @@
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");
start();
}
]);
});
+ module("Rounded corners");
+
+ asyncTest("Top and bottom corners rounded in inset list", 10, function() {
+ $.testHelper.pageSequence([
+ function() {
+ $.testHelper.openPage("#corner-rounded-test");
+ },
+
+ function() {
+ var ul = $('#corner-rounded-test ul');
+
+ for( var t = 0; t<5; t++){
+ ul.append("<li>Item " + t + "</li>");
+ ul.listview('refresh');
+ ok(ul.find("li").first().hasClass("ui-corner-top"), "First list item should have class ui-corner-top in list with " + ul.find("li").length + " item(s)");
+ ok(ul.find("li").last().hasClass("ui-corner-bottom"), "Last list item should have class ui-corner-bottom in list with " + ul.find("li").length + " item(s)");
+ }
+
+ start();
+ }
+ ]);
+ });
+
+
+
})(jQuery);

0 comments on commit dd2bdcd

Please sign in to comment.