mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
Testing: add removeWidget test
This commit is contained in:
parent
a0d29c99f4
commit
a33ed6c83e
@ -752,10 +752,14 @@ $(function(){
|
|||||||
/************************************************
|
/************************************************
|
||||||
test has widget function
|
test has widget function
|
||||||
************************************************/
|
************************************************/
|
||||||
QUnit.test( "has zebra widget", function(assert) {
|
QUnit.test( "has & remove zebra widget", function(assert) {
|
||||||
assert.expect(2);
|
assert.expect(3);
|
||||||
|
c2.widgets = [ 'zebra' ];
|
||||||
|
$table2.trigger('applyWidgets');
|
||||||
assert.equal( ts.hasWidget( table2, 'zebra'), true, 'table has zebra widget (using table element object)' );
|
assert.equal( ts.hasWidget( table2, 'zebra'), true, 'table has zebra widget (using table element object)' );
|
||||||
assert.equal( ts.hasWidget( $table2, 'zebra'), true, 'table has zebra widget (using jQuery table object)' );
|
assert.equal( ts.hasWidget( $table2, 'zebra'), true, 'table has zebra widget (using jQuery table object)' );
|
||||||
|
ts.removeWidget( table2, 'zebra' );
|
||||||
|
assert.equal( zebra() && c2.widgets.length === 0, false, 'zebra removed' );
|
||||||
});
|
});
|
||||||
|
|
||||||
/************************************************
|
/************************************************
|
||||||
|
Loading…
Reference in New Issue
Block a user