aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/dialog/dialog_tickets.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/dialog/dialog_tickets.js')
-rw-r--r--tests/unit/dialog/dialog_tickets.js21
1 files changed, 11 insertions, 10 deletions
diff --git a/tests/unit/dialog/dialog_tickets.js b/tests/unit/dialog/dialog_tickets.js
index bd9056153..a169bd1a5 100644
--- a/tests/unit/dialog/dialog_tickets.js
+++ b/tests/unit/dialog/dialog_tickets.js
@@ -12,12 +12,6 @@ asyncTest( "#3123: Prevent tabbing out of modal dialogs", function() {
inputs = el.find( "input" ),
widget = el.dialog( "widget" );
- inputs.eq( 1 ).focus();
- equal( document.activeElement, inputs[1], "Focus set on second input" );
- inputs.eq( 1 ).simulate( "keydown", { keyCode: $.ui.keyCode.TAB });
-
- setTimeout( checkTab, 2 );
-
function checkTab() {
ok( $.contains( widget, document.activeElement ), "Tab key event moved focus within the modal" );
@@ -32,14 +26,21 @@ asyncTest( "#3123: Prevent tabbing out of modal dialogs", function() {
el.remove();
start();
}
+
+ inputs.eq( 1 ).focus();
+ equal( document.activeElement, inputs[1], "Focus set on second input" );
+ inputs.eq( 1 ).simulate( "keydown", { keyCode: $.ui.keyCode.TAB });
+
+ setTimeout( checkTab, 2 );
});
test("#4826: setting resizable false toggles resizable on dialog", function() {
expect(6);
+ var i;
el = $('<div></div>').dialog({ resizable: false });
shouldnotresize("[default]");
- for (var i=0; i<2; i++) {
+ for (i=0; i<2; i++) {
el.dialog('close').dialog('open');
shouldnotresize('initialized with resizable false toggle ('+ (i+1) +')');
}
@@ -47,7 +48,7 @@ test("#4826: setting resizable false toggles resizable on dialog", function() {
el = $('<div></div>').dialog({ resizable: true });
shouldresize("[default]");
- for (var i=0; i<2; i++) {
+ for (i=0; i<2; i++) {
el.dialog('close').dialog('option', 'resizable', false).dialog('open');
shouldnotresize('set option resizable false toggle ('+ (i+1) +')');
}
@@ -108,7 +109,7 @@ test("#6137: dialog('open') causes form elements to reset on IE7", function() {
test("#6645: Missing element not found check in overlay", function(){
expect(2);
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()}});
+ 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');
@@ -119,7 +120,7 @@ test("#6966: Escape key closes all dialogs, not the top one", function(){
expect(8);
// test with 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, close: function(){ d2.remove()}});
+ d2 = $('<div title="dialog 2">Dialog 2</div>').dialog({modal: true, close: function(){ d2.remove(); }});
ok(d1.dialog("isOpen"), 'first dialog is open');
ok(d2.dialog("isOpen"), 'second dialog is open');
d2.simulate("keydown", {keyCode: $.ui.keyCode.ESCAPE});