2015-04-07 00:23:50 +00:00
|
|
|
define( [
|
|
|
|
"jquery",
|
2015-07-15 01:59:10 +00:00
|
|
|
"ui/widgets/dialog"
|
2015-04-07 00:23:50 +00:00
|
|
|
], function( $ ) {
|
2014-12-03 16:23:59 +00:00
|
|
|
|
|
|
|
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();
|
|
|
|
});
|
|
|
|
|
2015-04-07 00:23:50 +00:00
|
|
|
} );
|