aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/tabs/tabs_options.js
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2011-04-15 08:53:05 -0400
committerScott González <scott.gonzalez@gmail.com>2011-04-15 08:53:05 -0400
commitd3e10de6bce82bc6184eb7b5a4fd68247bc5905b (patch)
tree7d1d2f63e4c240d9962f73d2664ed02f271746fd /tests/unit/tabs/tabs_options.js
parent59c787fa4a975547e7789928126028bdfe132582 (diff)
downloadjquery-ui-d3e10de6bce82bc6184eb7b5a4fd68247bc5905b.tar.gz
jquery-ui-d3e10de6bce82bc6184eb7b5a4fd68247bc5905b.zip
Tabs: Better tests for tab state.
Diffstat (limited to 'tests/unit/tabs/tabs_options.js')
-rw-r--r--tests/unit/tabs/tabs_options.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/unit/tabs/tabs_options.js b/tests/unit/tabs/tabs_options.js
index 3cce96e1c..884a566c6 100644
--- a/tests/unit/tabs/tabs_options.js
+++ b/tests/unit/tabs/tabs_options.js
@@ -10,10 +10,11 @@ test( "{ active: default }", function() {
tabs_state( element, 1, 0, 0 );
element.tabs( "destroy" );
- window.location.hash = "#fragment-3";
+ location.hash = "#fragment-3";
element = $( "#tabs1" ).tabs();
equals( element.tabs( "option", "active" ), 2, "should be 2 based on URL" );
tabs_state( element, 0, 0, 1 );
+ element.tabs( "destroy" );
});
test( "{ active: false }", function() {
@@ -83,6 +84,17 @@ if ( $.uiBackCompat === false ) {
});
}
+test( "active - mismatched tab/panel order", function() {
+ expect( 3 );
+
+ location.hash = "#tabs7-2";
+ var element = $( "#tabs7" ).tabs();
+ equals( element.tabs( "option", "active" ), 1, "should be 1 based on URL" );
+ tabs_state( element, 0, 1 );
+ element.tabs( "option", "active", 0 );
+ tabs_state( element, 1, 0 );
+});
+
test( "{ collapsible: false }", function() {
expect( 4 );