diff options
Diffstat (limited to 'tests/unit/dialog/dialog_tickets.js')
-rw-r--r-- | tests/unit/dialog/dialog_tickets.js | 79 |
1 files changed, 2 insertions, 77 deletions
diff --git a/tests/unit/dialog/dialog_tickets.js b/tests/unit/dialog/dialog_tickets.js index cf4ab0219..2b0214718 100644 --- a/tests/unit/dialog/dialog_tickets.js +++ b/tests/unit/dialog/dialog_tickets.js @@ -99,10 +99,10 @@ test("#6137: dialog('open') causes form elements to reset on IE7", function() { '<input type="radio" name="radio" id="b" value="b">b</input></form>').appendTo( "body" ).dialog({autoOpen: false}); d1.find('#b').prop( "checked", true ); - equal($('input:checked').val(), 'b', "checkbox b is checked"); + equal(d1.find('input:checked').val(), 'b', "checkbox b is checked"); d1.dialog('open'); - equal($('input:checked').val(), 'b', "checkbox b is checked"); + equal(d1.find('input:checked').val(), 'b', "checkbox b is checked"); d1.remove(); }); @@ -117,81 +117,6 @@ test("#6645: Missing element not found check in overlay", function(){ d1.add(d2).remove(); }); -test("#6966: Escape key closes all dialogs, not the top one", function(){ - expect(24); - // test with close function removing dialog triggered through the overlay - d1 = $('<div title="dialog 1">Dialog 1</div>').dialog({modal: true, close: function(){ d1.remove(); }}); - d2 = $('<div title="dialog 2">Dialog 2</div>').dialog({modal: true, close: function(){ d2.remove(); }}); - - ok(d1.data('dialog') && d1.dialog('isOpen'), 'first dialog is open'); - ok(d2.data('dialog') && d2.dialog('isOpen'), 'second dialog is open'); - - $( document ).simulate('keydown', {keyCode: $.ui.keyCode.ESCAPE}); - ok(d1.data('dialog') && d1.dialog('isOpen'), 'first dialog still open'); - ok(!d2.data('dialog'), 'second dialog is closed'); - - $( document ).simulate('keydown', {keyCode: $.ui.keyCode.ESCAPE}); - ok(!d1.data('dialog'), 'first dialog is closed'); - ok(!d2.data('dialog'), 'second dialog is closed'); - - d2.remove(); - d1.remove(); - - // test with close function removing dialog triggered through the dialog - d1 = $('<div title="dialog 1">Dialog 1</div>').dialog({modal: true, close: function(){ d1.remove(); }}); - d2 = $('<div title="dialog 2">Dialog 2</div>').dialog({modal: true, close: function(){ d2.remove(); }}); - - ok(d1.data('dialog') && d1.dialog('isOpen'), 'first dialog is open'); - ok(d2.data('dialog') && d2.dialog('isOpen'), 'second dialog is open'); - - d2.simulate('keydown', {keyCode: $.ui.keyCode.ESCAPE}); - ok(d1.data('dialog') && d1.dialog('isOpen'), 'first dialog still open'); - ok(!d2.data('dialog'), 'second dialog is closed'); - - d1.simulate('keydown', {keyCode: $.ui.keyCode.ESCAPE}); - ok(!d1.data('dialog'), 'first dialog is closed'); - ok(!d2.data('dialog'), 'second dialog is closed'); - - d2.remove(); - d1.remove(); - - // test without close function removing dialog - d1 = $('<div title="dialog 1">Dialog 1</div>').dialog({modal: true}); - d2 = $('<div title="dialog 2">Dialog 2</div>').dialog({modal: true}); - - ok(d1.dialog("isOpen"), 'first dialog is open'); - ok(d2.dialog("isOpen"), 'second dialog is open'); - - d2.simulate("keydown", {keyCode: $.ui.keyCode.ESCAPE}); - ok(d1.dialog("isOpen"), 'first dialog still open'); - ok(!d2.dialog("isOpen"), 'second dialog is closed'); - - d1.simulate("keydown", {keyCode: $.ui.keyCode.ESCAPE}); - ok(!d1.dialog("isOpen"), 'first dialog is closed'); - ok(!d2.dialog("isOpen"), 'second dialog is closed'); - - d2.remove(); - d1.remove(); - - // test without close function removing dialog triggered through the overlay - d1 = $('<div title="dialog 1">Dialog 1</div>').dialog({modal: true}); - d2 = $('<div title="dialog 2">Dialog 2</div>').dialog({modal: true}); - - ok(d1.dialog("isOpen"), 'first dialog is open'); - ok(d2.dialog("isOpen"), 'second dialog is open'); - - $( document ).simulate("keydown", {keyCode: $.ui.keyCode.ESCAPE}); - ok(d1.dialog("isOpen"), 'first dialog still open'); - ok(!d2.dialog("isOpen"), 'second dialog is closed'); - - $( document ).simulate("keydown", {keyCode: $.ui.keyCode.ESCAPE}); - ok(!d1.dialog("isOpen"), 'first dialog is closed'); - ok(!d2.dialog("isOpen"), 'second dialog is closed'); - - d2.remove(); - d1.remove(); -}); - test("#4980: Destroy should place element back in original DOM position", function(){ expect( 2 ); container = $('<div id="container"><div id="modal">Content</div></div>'); |