2014-12-03 16:23:59 +00:00
|
|
|
(function( $ ) {
|
|
|
|
|
|
|
|
module( "dialog (deprecated): options" );
|
|
|
|
|
2015-01-30 14:57:04 +00:00
|
|
|
test( "dialogClass", function( assert ) {
|
|
|
|
expect( 5 );
|
2014-12-03 16:23:59 +00:00
|
|
|
|
|
|
|
var element = $( "<div>" ).dialog(),
|
|
|
|
widget = element.dialog( "widget" );
|
2015-01-30 14:57:04 +00:00
|
|
|
assert.lacksClasses( widget, "foo", "dialogClass not specified. class not added" );
|
2014-12-03 16:23:59 +00:00
|
|
|
element.remove();
|
|
|
|
|
|
|
|
element = $( "<div>" ).dialog({ dialogClass: "foo" });
|
|
|
|
widget = element.dialog( "widget" );
|
2015-01-30 14:57:04 +00:00
|
|
|
assert.hasClasses( widget, "foo", "dialogClass in init, foo class added" );
|
2014-12-03 16:23:59 +00:00
|
|
|
element.dialog( "option", "dialogClass", "foobar" );
|
2015-01-30 14:57:04 +00:00
|
|
|
assert.lacksClasses( widget, "foo", "dialogClass changed, previous one was removed" );
|
|
|
|
assert.hasClasses( widget, "foobar", "dialogClass changed, new one was added" );
|
2014-12-03 16:23:59 +00:00
|
|
|
element.remove();
|
|
|
|
|
|
|
|
element = $( "<div>" ).dialog({ dialogClass: "foo bar" });
|
|
|
|
widget = element.dialog( "widget" );
|
2015-01-30 14:57:04 +00:00
|
|
|
assert.hasClasses( widget, "foo bar", "dialogClass in init, two classes." );
|
2014-12-03 16:23:59 +00:00
|
|
|
element.remove();
|
|
|
|
});
|
|
|
|
|
|
|
|
})( jQuery );
|