Permalink
Browse files

Added test for issue #1470

Corner styling issue with listview refresh on growing lists
  • Loading branch information...
1 parent 39d2cd7 commit 9dcbee5d8cb3171018dbc463573f7fcfa7ff3c3b Ghislain Seguin committed May 18, 2011
Showing with 38 additions and 0 deletions.
  1. +5 −0 tests/unit/listview/index.html
  2. +33 −0 tests/unit/listview/listview_core.js
@@ -223,5 +223,10 @@ <h1>Split List View</h1>
</div>
</div>
+<!-- Programmatically generated list items !-->
+<div data-nstest-role="page" id="programmatically-generated-list">
+ <ul data-nstest-role="listview" data-nstest-inset="true" id="programmatically-generated-list-items"></ul>
+</div>
+
</body>
</html>
@@ -306,4 +306,37 @@
}, 1000);
});
+ module( "Programmatically generated list items", {
+ setup: function(){
+ var item,
+ data = [
+ {id: 1,
+ label: "Item 1"
+ },
+ {id: 2,
+ label: "Item 2"
+ },
+ {id: 3,
+ label: "Item 3"
+ },
+ {id: 4,
+ label: "Item 4"
+ }
+ ];
+
+ $.testHelper.openPage("#programmatically-generated-list");
+
+ for (var i = 0, len = data.length; i < len; i++) {
+ item = $('<li id="myItem' + data[i].id + '">');
+ label = $("<strong>" + data[i].label + "</strong>").appendTo(item);
+ $('#programmatically-generated-list-items').append(item);
+ $('#programmatically-generated-list-items').listview('refresh');
+ }
+ }
+ });
+
+ test( "Corner styling issue (#1470)", function() {
+ ok(!$('#programmatically-generated-list-items li:first-child').hasClass("ui-corner-bottom"), "First list item should not have class ui-corner-bottom");
+ });
+
})(jQuery);

0 comments on commit 9dcbee5

Please sign in to comment.