diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2012-11-16 19:46:01 +0100 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2012-11-26 10:28:24 +0100 |
commit | 299681e8f0896cd0448fa08003bb7b733adc489f (patch) | |
tree | 6823ae68692a10b71b0329a6a238ba9313b7462a /tests/unit/dialog/dialog_tickets.js | |
parent | b694409e76181dbfdfec9419d9c3f688ff183a53 (diff) | |
download | jquery-ui-299681e8f0896cd0448fa08003bb7b733adc489f.tar.gz jquery-ui-299681e8f0896cd0448fa08003bb7b733adc489f.zip |
Dialog: Cleanup in ticket tests: TODO to merge one test, fix whitespace
Diffstat (limited to 'tests/unit/dialog/dialog_tickets.js')
-rw-r--r-- | tests/unit/dialog/dialog_tickets.js | 59 |
1 files changed, 30 insertions, 29 deletions
diff --git a/tests/unit/dialog/dialog_tickets.js b/tests/unit/dialog/dialog_tickets.js index 3055c5fc1..655f1e445 100644 --- a/tests/unit/dialog/dialog_tickets.js +++ b/tests/unit/dialog/dialog_tickets.js @@ -71,24 +71,24 @@ test("#5184: isOpen in dialogclose event is true", function() { }); test("#5531: dialog width should be at least minWidth on creation", function () { - expect( 4 ); - var el = $('<div></div>').dialog({ - width: 200, - minWidth: 300 - }); - - equal(el.dialog('option', 'width'), 300, "width is minWidth"); - el.dialog('option', 'width', 200); - equal(el.dialog('option', 'width'), 300, "width unchanged when set to < minWidth"); - el.dialog('option', 'width', 320); - equal(el.dialog('option', 'width'), 320, "width changed if set to > minWidth"); - el.remove(); - - el = $('<div></div>').dialog({ - minWidth: 300 - }); - ok(el.dialog('option', 'width') >= 300, "width is at least 300"); - el.remove(); + expect( 4 ); + var el = $('<div></div>').dialog({ + width: 200, + minWidth: 300 + }); + + equal(el.dialog('option', 'width'), 300, "width is minWidth"); + el.dialog('option', 'width', 200); + equal(el.dialog('option', 'width'), 300, "width unchanged when set to < minWidth"); + el.dialog('option', 'width', 320); + equal(el.dialog('option', 'width'), 320, "width changed if set to > minWidth"); + el.remove(); + + el = $('<div></div>').dialog({ + minWidth: 300 + }); + ok(el.dialog('option', 'width') >= 300, "width is at least 300"); + el.remove(); }); @@ -108,20 +108,21 @@ test("#6137: dialog('open') causes form elements to reset on IE7", function() { }); test("#6645: Missing element not found check in overlay", function(){ - expect(2); - var d1 = $('<div title="dialog 1">Dialog 1</div>').dialog({modal: true}), - d2 = $('<div title="dialog 2">Dialog 2</div>').dialog({modal: true, close: function(){ d2.remove(); }}); - - equal($.ui.dialog.overlay.instances.length, 2, 'two overlays created'); - d2.dialog('close'); - equal($.ui.dialog.overlay.instances.length, 1, 'one overlay remains after closing the 2nd overlay'); - d1.add(d2).remove(); + expect(2); + var d1 = $('<div title="dialog 1">Dialog 1</div>').dialog({modal: true}), + d2 = $('<div title="dialog 2">Dialog 2</div>').dialog({modal: true, close: function(){ d2.remove(); }}); + + equal($.ui.dialog.overlay.instances.length, 2, 'two overlays created'); + d2.dialog('close'); + equal($.ui.dialog.overlay.instances.length, 1, 'one overlay remains after closing the 2nd overlay'); + d1.add(d2).remove(); }); +// TODO merge this with the main destroy test test("#4980: Destroy should place element back in original DOM position", function(){ - expect( 2 ); - var container = $('<div id="container"><div id="modal">Content</div></div>'), - modal = container.find('#modal'); + expect( 2 ); + var container = $('<div id="container"><div id="modal">Content</div></div>'), + modal = container.find('#modal'); modal.dialog(); ok(!$.contains(container[0], modal[0]), 'dialog should move modal element to outside container element'); modal.dialog('destroy'); |