Skip to content
Permalink
Browse files

Tabs: Updated tests for disabled option.

  • Loading branch information...
scottgonzalez committed May 9, 2011
1 parent ea01e7f commit 6a9b789bc7f3ef99036974c1c06695aef091a994
Showing with 19 additions and 13 deletions.
  1. +19 −13 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);

0 comments on commit 6a9b789

Please sign in to comment.
You can’t perform that action at this time.