Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
Table: Implement Classes Option
Browse files Browse the repository at this point in the history
test adjustments

Fixes gh-8341
  • Loading branch information
cgack authored and arschmitz committed Mar 28, 2016
1 parent 7c0a285 commit 10bee2c
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions 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 );

Expand All @@ -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 );

0 comments on commit 10bee2c

Please sign in to comment.