aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/tabs
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2011-05-09 17:10:36 -0400
committerScott González <scott.gonzalez@gmail.com>2011-05-09 17:10:36 -0400
commit6a9b789bc7f3ef99036974c1c06695aef091a994 (patch)
tree5aade2343948c2c36a05b56267a1298ef084571f /tests/unit/tabs
parentea01e7fc50bb9480ee92dd3989dbdeb89cb71562 (diff)
downloadjquery-ui-6a9b789bc7f3ef99036974c1c06695aef091a994.tar.gz
jquery-ui-6a9b789bc7f3ef99036974c1c06695aef091a994.zip
Tabs: Updated tests for disabled option.
Diffstat (limited to 'tests/unit/tabs')
-rw-r--r--tests/unit/tabs/tabs_options.js32
1 files changed, 19 insertions, 13 deletions
diff --git a/tests/unit/tabs/tabs_options.js b/tests/unit/tabs/tabs_options.js
index 7e2d9baf5..97fd87bf6 100644
--- a/tests/unit/tabs/tabs_options.js
+++ b/tests/unit/tabs/tabs_options.js
@@ -133,20 +133,28 @@ test( "{ collapsible: true }", function() {
tabs_state( element, 0, 0, 0 );
});
-test('disabled', function() {
- expect(4);
+test( "disabled", function() {
+ expect( 10 );
- el = $('#tabs1').tabs();
- same(el.tabs('option', 'disabled'), false, "should not disable any tab by default");
+ // fully enabled by default
+ var element = $( "#tabs1" ).tabs();
+ tabs_disabled( element, false );
+
+ // disable single tab
+ element.tabs( "option", "disabled", [ 1 ] );
+ tabs_disabled( element, [ 1 ] );
- el.tabs('option', 'disabled', [ 1 ]);
- same(el.tabs('option', 'disabled'), [ 1 ], "should set property"); // everything else is being tested in methods module...
+ // disabled active tab
+ element.tabs( "option", "disabled", [ 0, 1 ] );
+ tabs_disabled( element, [ 0, 1 ] );
- el.tabs('option', 'disabled', [ 0, 1 ]);
- same(el.tabs('option', 'disabled'), [ 0, 1 ], "should disable given tabs, even selected one"); // ...
+ // disable all tabs
+ element.tabs( "option", "disabled", [ 0, 1, 2 ] );
+ tabs_disabled( element, true );
- el.tabs('option', 'disabled', [ ]);
- same(el.tabs('option', 'disabled'), false, "should not disable any tab"); // ...
+ // enable all tabs
+ element.tabs( "option", "disabled", [] );
+ tabs_disabled( element, false );
});
test( "{ event: null }", function() {
@@ -200,8 +208,6 @@ test( "{ event: custom }", function() {
tabs_state( element, 0, 1, 0 );
});
-test('fx', function() {
- ok(false, "missing test - untested code is broken code.");
-});
+// TODO: add animation tests
})(jQuery);