From 4487aba8a0eb38eea6b4dc6992ddc78219d598ee Mon Sep 17 00:00:00 2001 From: Ghislain Seguin Date: Mon, 20 Jun 2011 13:16:09 -0700 Subject: [PATCH] Fixed test case for programmatically created list items --- tests/unit/listview/listview_core.js | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/tests/unit/listview/listview_core.js b/tests/unit/listview/listview_core.js index 2ecb5b13..a4023657 100644 --- a/tests/unit/listview/listview_core.js +++ b/tests/unit/listview/listview_core.js @@ -408,19 +408,27 @@ } ]; - $.testHelper.openPage("#programmatically-generated-list"); + $( "#programmatically-generated-list-items" ).html(""); for (var i = 0, len = data.length; i < len; i++) { item = $('
  • '); - label = $("" + data[i].label + "").appendTo(item); - $('#programmatically-generated-list-items').append(item); - $('#programmatically-generated-list-items').listview('refresh'); + label = $( "" + data[i].label + "").appendTo( item ); + $( "#programmatically-generated-list-items" ).append( item ); } } }); - 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"); + asyncTest( "Corner styling on programmatically created list items", function() { + // https://github.com/jquery/jquery-mobile/issues/1470 + $.testHelper.pageSequence([ + function() { + $.testHelper.openPage( "#programmatically-generated-list" ); + }, + function() { + ok(!$( "#programmatically-generated-list-items li:first-child" ).hasClass( "ui-corner-bottom" ), "First list item should not have class ui-corner-bottom" ); + start(); + } + ]); }); module("Programmatic list items manipulation");