aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/tabs
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2012-06-12 10:07:16 -0400
committerScott González <scott.gonzalez@gmail.com>2012-06-12 10:07:16 -0400
commit9ebeb0616a5ca556e507aecbe360f5dcec238737 (patch)
tree0fc86adf4e16b37a3a3d39162bf6015fad06e744 /tests/unit/tabs
parent9e805c0384133ad01969b6cee4e9bb294e8e4c00 (diff)
downloadjquery-ui-9ebeb0616a5ca556e507aecbe360f5dcec238737.tar.gz
jquery-ui-9ebeb0616a5ca556e507aecbe360f5dcec238737.zip
Tabs: Walk previous tabs (and loop) in refresh() in case the tab we're trying to activate is disabled.
Diffstat (limited to 'tests/unit/tabs')
-rw-r--r--tests/unit/tabs/tabs_methods.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/unit/tabs/tabs_methods.js b/tests/unit/tabs/tabs_methods.js
index ed3e73745..e48d353e7 100644
--- a/tests/unit/tabs/tabs_methods.js
+++ b/tests/unit/tabs/tabs_methods.js
@@ -148,6 +148,26 @@ test( "refresh", function() {
disabled( element, false );
});
+test( "refresh - looping", function() {
+ expect( 6 );
+
+ var element = $( "#tabs1" ).tabs({
+ disabled: [ 0 ],
+ active: 1
+ });
+ state( element, 0, 1, 0 );
+ disabled( element, [ 0 ] );
+
+ // remove active, jump to previous
+ // previous is disabled, just back one more
+ // reached first tab, move to end
+ // activate last tab
+ element.find( ".ui-tabs-nav li" ).eq( 2 ).remove();
+ element.tabs( "refresh" );
+ state( element, 0, 1 );
+ disabled( element, [ 0 ] );
+});
+
asyncTest( "load", function() {
expect( 30 );