diff options
author | Alexander Schmitz <arschmitz@gmail.com> | 2014-12-03 11:23:59 -0500 |
---|---|---|
committer | Alexander Schmitz <arschmitz@gmail.com> | 2015-03-11 16:04:11 -0400 |
commit | 6f4884f6f5b422bacbb20dbd82d90d351a985a4b (patch) | |
tree | 5031a8fed24efe4883150d313b6863e9e36f9b81 /tests/unit/dialog/dialog_deprecated.js | |
parent | cff1fb2a13e18403c02ba516e08db3a5b21a8b6c (diff) | |
download | jquery-ui-6f4884f6f5b422bacbb20dbd82d90d351a985a4b.tar.gz jquery-ui-6f4884f6f5b422bacbb20dbd82d90d351a985a4b.zip |
Dialog: Add classes option
Ref #7053
Ref gh-1411
Diffstat (limited to 'tests/unit/dialog/dialog_deprecated.js')
-rw-r--r-- | tests/unit/dialog/dialog_deprecated.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/unit/dialog/dialog_deprecated.js b/tests/unit/dialog/dialog_deprecated.js new file mode 100644 index 000000000..6a26c229e --- /dev/null +++ b/tests/unit/dialog/dialog_deprecated.js @@ -0,0 +1,28 @@ +(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 ); |