diff options
author | Mike Sherov <mike.sherov@gmail.com> | 2012-12-07 20:06:29 -0500 |
---|---|---|
committer | Mike Sherov <mike.sherov@gmail.com> | 2012-12-07 20:06:29 -0500 |
commit | e83a89dd7df3009d46ddd9e7e1cabf42e901e397 (patch) | |
tree | 8ada242bd81857ace993ce09625d06236530cc4a /tests/unit/dialog/dialog_methods.js | |
parent | d4551bc3b8dfbfd925700dcb9f71e7729b125889 (diff) | |
download | jquery-ui-e83a89dd7df3009d46ddd9e7e1cabf42e901e397.tar.gz jquery-ui-e83a89dd7df3009d46ddd9e7e1cabf42e901e397.zip |
Dev: Remove *_tickets.js test files and move the associated tests to the proper locations.
Diffstat (limited to 'tests/unit/dialog/dialog_methods.js')
-rw-r--r-- | tests/unit/dialog/dialog_methods.js | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/tests/unit/dialog/dialog_methods.js b/tests/unit/dialog/dialog_methods.js index 92fe3d60f..fbb649fbf 100644 --- a/tests/unit/dialog/dialog_methods.js +++ b/tests/unit/dialog/dialog_methods.js @@ -137,4 +137,52 @@ test("open", function() { ok(el.dialog('widget').is(':visible') && !el.dialog('widget').is(':hidden'), 'dialog visible after open method called'); }); +// 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'); + modal.dialog(); + ok(!$.contains(container[0], modal[0]), 'dialog should move modal element to outside container element'); + modal.dialog('destroy'); + ok($.contains(container[0], modal[0]), 'dialog(destroy) should place element back in original DOM position'); +}); + +test("#6137: dialog('open') causes form elements to reset on IE7", function() { + expect(2); + + var d1 = $('<form><input type="radio" name="radio" id="a" value="a" checked="checked"></input>' + + '<input type="radio" name="radio" id="b" value="b">b</input></form>').appendTo( "body" ).dialog({autoOpen: false}); + + d1.find('#b').prop( "checked", true ); + equal(d1.find('input:checked').val(), 'b', "checkbox b is checked"); + + d1.dialog('open'); + equal(d1.find('input:checked').val(), 'b', "checkbox b is checked"); + + d1.remove(); +}); + +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(); + +}); + })(jQuery); |