aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/tabs
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2015-02-17 16:11:58 +0100
committerJörn Zaefferer <joern.zaefferer@gmail.com>2015-03-04 23:04:07 +0100
commit666f051c3a7c0313acacad0255ab8a45697777c3 (patch)
treece60522e6bd237ca14ae41270e6e6159190593e5 /tests/unit/tabs
parent19783fd3e6a6e6e02a2030028e8820076c3b1295 (diff)
downloadjquery-ui-666f051c3a7c0313acacad0255ab8a45697777c3.tar.gz
jquery-ui-666f051c3a7c0313acacad0255ab8a45697777c3.zip
Tests: Reduce timeouts to optimize testsuite runtime
Diffstat (limited to 'tests/unit/tabs')
-rw-r--r--tests/unit/tabs/tabs_core.js40
-rw-r--r--tests/unit/tabs/tabs_methods.js4
-rw-r--r--tests/unit/tabs/tabs_options.js4
3 files changed, 24 insertions, 24 deletions
diff --git a/tests/unit/tabs/tabs_core.js b/tests/unit/tabs/tabs_core.js
index 2d18a6f1a..ab3c81175 100644
--- a/tests/unit/tabs/tabs_core.js
+++ b/tests/unit/tabs/tabs_core.js
@@ -155,7 +155,7 @@ asyncTest( "keyboard support - LEFT, RIGHT, UP, DOWN, HOME, END, SPACE, ENTER",
panels = element.find( ".ui-tabs-panel" ),
keyCode = $.ui.keyCode;
- element.tabs( "instance" ).delay = 50;
+ element.tabs( "instance" ).delay = 1;
equal( tabs.filter( ".ui-state-focus" ).length, 0, "no tabs focused on init" );
tabs.eq( 0 ).simulate( "focus" );
@@ -208,7 +208,7 @@ asyncTest( "keyboard support - LEFT, RIGHT, UP, DOWN, HOME, END, SPACE, ENTER",
equal( tabs.eq( 0 ).attr( "aria-expanded" ), "true", "first tab has aria-expanded=true" );
equal( panels.eq( 0 ).attr( "aria-hidden" ), "false", "first panel has aria-hidden=false" );
- setTimeout( step2, 100 );
+ setTimeout( step2, 25 );
}
// left, home, space
@@ -246,7 +246,7 @@ asyncTest( "keyboard support - LEFT, RIGHT, UP, DOWN, HOME, END, SPACE, ENTER",
// SPACE activates, cancels delay
tabs.eq( 0 ).simulate( "keydown", { keyCode: keyCode.SPACE } );
- setTimeout( step3, 1 );
+ setTimeout( step3 );
}
// end, enter
@@ -273,7 +273,7 @@ asyncTest( "keyboard support - LEFT, RIGHT, UP, DOWN, HOME, END, SPACE, ENTER",
// ENTER activates, cancels delay
tabs.eq( 0 ).simulate( "keydown", { keyCode: keyCode.ENTER } );
- setTimeout( step4, 1 );
+ setTimeout( step4 );
}
// enter (collapse)
@@ -293,10 +293,10 @@ asyncTest( "keyboard support - LEFT, RIGHT, UP, DOWN, HOME, END, SPACE, ENTER",
equal( tabs.eq( 2 ).attr( "aria-expanded" ), "false", "third tab has aria-expanded=false" );
equal( panels.eq( 2 ).attr( "aria-hidden" ), "true", "third panel has aria-hidden=true" );
- setTimeout( start, 1 );
+ setTimeout( start );
}
- setTimeout( step1, 1 );
+ setTimeout( step1 );
});
// Navigation with CTRL and COMMAND (both behave the same)
@@ -311,7 +311,7 @@ $.each({
panels = element.find( ".ui-tabs-panel" ),
keyCode = $.ui.keyCode;
- element.tabs( "instance" ).delay = 50;
+ element.tabs( "instance" ).delay = 1;
equal( tabs.filter( ".ui-state-focus" ).length, 0, "no tabs focused on init" );
tabs.eq( 0 ).simulate( "focus" );
@@ -337,7 +337,7 @@ $.each({
equal( tabs.eq( 0 ).attr( "aria-expanded" ), "true", "first tab has aria-expanded=true" );
equal( panels.eq( 0 ).attr( "aria-hidden" ), "false", "first panel has aria-hidden=false" );
- setTimeout( step2, 100 );
+ setTimeout( step2, 25 );
}
// right
@@ -364,7 +364,7 @@ $.each({
equal( tabs.eq( 0 ).attr( "aria-expanded" ), "true", "first tab has aria-expanded=true" );
equal( panels.eq( 0 ).attr( "aria-hidden" ), "false", "first panel has aria-hidden=false" );
- setTimeout( step3, 100 );
+ setTimeout( step3, 25 );
}
// down (wrap)
@@ -387,7 +387,7 @@ $.each({
equal( tabs.eq( 0 ).attr( "aria-expanded" ), "true", "first tab has aria-expanded=true" );
equal( panels.eq( 0 ).attr( "aria-hidden" ), "false", "first panel has aria-hidden=false" );
- setTimeout( step4, 100 );
+ setTimeout( step4, 25 );
}
// up (wrap)
@@ -411,7 +411,7 @@ $.each({
equal( tabs.eq( 0 ).attr( "aria-expanded" ), "true", "first tab has aria-expanded=true" );
equal( panels.eq( 0 ).attr( "aria-hidden" ), "false", "first panel has aria-hidden=false" );
- setTimeout( step5, 100 );
+ setTimeout( step5, 25 );
}
// left
@@ -438,7 +438,7 @@ $.each({
equal( tabs.eq( 0 ).attr( "aria-expanded" ), "true", "first tab has aria-expanded=true" );
equal( panels.eq( 0 ).attr( "aria-hidden" ), "false", "first panel has aria-hidden=false" );
- setTimeout( step6, 100 );
+ setTimeout( step6, 25 );
}
// home
@@ -465,7 +465,7 @@ $.each({
equal( tabs.eq( 0 ).attr( "aria-expanded" ), "true", "first tab has aria-expanded=true" );
equal( panels.eq( 0 ).attr( "aria-hidden" ), "false", "first panel has aria-hidden=false" );
- setTimeout( step7, 100 );
+ setTimeout( step7, 25 );
}
// end
@@ -489,7 +489,7 @@ $.each({
equal( tabs.eq( 0 ).attr( "aria-expanded" ), "true", "first tab has aria-expanded=true" );
equal( panels.eq( 0 ).attr( "aria-hidden" ), "false", "first panel has aria-hidden=false" );
- setTimeout( step8, 100 );
+ setTimeout( step8, 25 );
}
// space
@@ -512,10 +512,10 @@ $.each({
equal( tabs.eq( 0 ).attr( "aria-expanded" ), "false", "first tab has aria-expanded=false" );
equal( panels.eq( 0 ).attr( "aria-hidden" ), "true", "first panel has aria-hidden=true" );
- setTimeout( start, 1 );
+ setTimeout( start );
}
- setTimeout( step1, 1 );
+ setTimeout( step1 );
});
});
@@ -567,7 +567,7 @@ asyncTest( "keyboard support - CTRL+UP, ALT+PAGE_DOWN, ALT+PAGE_UP", function()
equal( panels.eq( 2 ).attr( "aria-hidden" ), "true", "third panel has aria-hidden=true" );
panels.eq( 0 ).simulate( "focus" );
- setTimeout( step2, 1 );
+ setTimeout( step2 );
}
function step2() {
@@ -596,7 +596,7 @@ asyncTest( "keyboard support - CTRL+UP, ALT+PAGE_DOWN, ALT+PAGE_UP", function()
equal( panels.eq( 2 ).attr( "aria-hidden" ), "true", "third panel has aria-hidden=true" );
panels.eq( 1 ).simulate( "focus" );
- setTimeout( step3, 1 );
+ setTimeout( step3 );
}
function step3() {
@@ -605,10 +605,10 @@ asyncTest( "keyboard support - CTRL+UP, ALT+PAGE_DOWN, ALT+PAGE_UP", function()
panels.eq( 1 ).simulate( "keydown", { keyCode: keyCode.UP, ctrlKey: true } );
strictEqual( document.activeElement, tabs[ 1 ], "second tab is activeElement" );
- setTimeout( start, 1 );
+ setTimeout( start );
}
- setTimeout( step1, 1 );
+ setTimeout( step1 );
});
test( "#3627 - Ajax tab with url containing a fragment identifier fails to load", function() {
diff --git a/tests/unit/tabs/tabs_methods.js b/tests/unit/tabs/tabs_methods.js
index a3d663f27..073430b77 100644
--- a/tests/unit/tabs/tabs_methods.js
+++ b/tests/unit/tabs/tabs_methods.js
@@ -206,7 +206,7 @@ asyncTest( "load", function() {
strictEqual( uiPanel[ 0 ], panel[ 0 ], "panel" );
equal( uiPanel.find( "p" ).length, 1, "panel html" );
state( element, 1, 0, 0, 0, 0 );
- setTimeout( tabsload1, 100 );
+ setTimeout( tabsload1 );
});
element.tabs( "load", 3 );
state( element, 1, 0, 0, 0, 0 );
@@ -218,7 +218,7 @@ asyncTest( "load", function() {
});
element.one( "tabsload", function() {
ok( true, "tabsload invoked" );
- setTimeout( tabsload2, 100 );
+ setTimeout( tabsload2 );
});
element.tabs( "option", "active", 3 );
state( element, 0, 0, 0, 1, 0 );
diff --git a/tests/unit/tabs/tabs_options.js b/tests/unit/tabs/tabs_options.js
index 7f5352bac..56e32b7da 100644
--- a/tests/unit/tabs/tabs_options.js
+++ b/tests/unit/tabs/tabs_options.js
@@ -347,7 +347,7 @@ asyncTest( "hide and show - animation", function() {
equal( options, "drop", "correct options in _show()" );
setTimeout(function() {
callback();
- }, 1 );
+ });
};
widget._hide = function( element, options, callback ) {
strictEqual( element[ 0 ], panels[ 0 ], "correct element in _hide()" );
@@ -355,7 +355,7 @@ asyncTest( "hide and show - animation", function() {
setTimeout(function() {
callback();
start();
- }, 1 );
+ });
};
ok( panels.eq( 0 ).is( ":visible" ), "first panel visible" );