jquery-ui/tests/unit/dialog/dialog_deprecated.js
Alexander Schmitz 6f4884f6f5 Dialog: Add classes option
Ref #7053
Ref gh-1411
2015-03-11 16:04:11 -04:00

29 lines
1021 B
JavaScript

(function( $ ) {
module( "dialog (deprecated): options" );
test( "dialogClass", function() {
expect( 6 );
var element = $( "<div>" ).dialog(),
widget = element.dialog( "widget" );
equal( widget.is( ".foo" ), false, "dialogClass not specified. class not added" );
element.remove();
element = $( "<div>" ).dialog({ dialogClass: "foo" });
widget = element.dialog( "widget" );
equal( widget.is( ".foo" ), true, "dialogClass in init, foo class added" );
element.dialog( "option", "dialogClass", "foobar" );
equal( widget.is( ".foo" ), false, "dialogClass changed, previous one was removed" );
equal( widget.is( ".foobar" ), true, "dialogClass changed, new one was added" );
element.remove();
element = $( "<div>" ).dialog({ dialogClass: "foo bar" });
widget = element.dialog( "widget" );
equal( widget.is( ".foo" ), true, "dialogClass in init, two classes. foo class added" );
equal( widget.is( ".bar" ), true, "dialogClass in init, two classes. bar class added" );
element.remove();
});
})( jQuery );