diff --git a/tests/integration/table/grouped_core.js b/tests/integration/table/grouped_core.js index 5440618f41c..9c6e780eba1 100644 --- a/tests/integration/table/grouped_core.js +++ b/tests/integration/table/grouped_core.js @@ -1,15 +1,17 @@ -function runAssertions( prefix, table, expectedColstart ) { +( function( QUnit, $ ) { +function runAssertions( prefix, table, expectedColstart, assert ) { var expectedCells = table.find( "[data-column]" ), header = table.find( ".test-column-header" ); - deepEqual( header.data( $.camelCase( $.mobile.ns + "cells" ) ).is( function( index, cell ) { + assert.deepEqual( header.data( $.camelCase( $.mobile.ns + "cells" ) ).is( + function( index, cell ) { return ( expectedCells.index( cell ) < 0 ); - }), false, + } ), false, prefix + "header's 'cells' data item contains the right cells." ); - deepEqual( table.find( ".test-column-header" ).jqmData( "colstart" ), expectedColstart, + assert.deepEqual( table.find( ".test-column-header" ).jqmData( "colstart" ), expectedColstart, prefix + "header's 'colstart' attribute points to the right column" ); - deepEqual( + assert.deepEqual( table.find( "[data-top-label]" ).is( function() { var cell = $( this ); @@ -20,20 +22,21 @@ function runAssertions( prefix, table, expectedColstart ) { cell .children( "b.ui-table-cell-label.ui-table-cell-label-top" ) .length === 1 ); - }), + } ), false, - prefix + "Cells in the first of a group of columns have both group and column reflow labels" ); + prefix + "Cells in the first of a group of columns have both group and column reflow labels" + ); } - - function beforeAndAfterRefresh( prefix, table, expectedColStart ) { - test( prefix + "correct rendering", function() { - runAssertions( "initially: ", table, expectedColStart ); + QUnit.test( prefix + "correct rendering", function( assert ) { + runAssertions( "initially: ", table, expectedColStart, assert ); table.table( "refresh" ); - runAssertions( "after refresh(): ", table, expectedColStart ); - }); + runAssertions( "after refresh(): ", table, expectedColStart, assert ); + } ); } beforeAndAfterRefresh( "With colspan: ", $( "#grouped-test-table" ), 5 ); beforeAndAfterRefresh( "Without colspan: ", $( "#single-column-grouped" ), 1 ); + +} ) ( QUnit, jQuery );