Testing: add removeWidget test

This commit is contained in:
Mottie 2015-07-23 07:33:22 -05:00
parent a0d29c99f4
commit a33ed6c83e

View File

@ -752,10 +752,14 @@ $(function(){
/************************************************
test has widget function
************************************************/
QUnit.test( "has zebra widget", function(assert) {
assert.expect(2);
QUnit.test( "has & remove zebra widget", function(assert) {
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 jQuery table object)' );
ts.removeWidget( table2, 'zebra' );
assert.equal( zebra() && c2.widgets.length === 0, false, 'zebra removed' );
});
/************************************************