diff options
author | Scott González <scott.gonzalez@gmail.com> | 2013-07-03 14:38:35 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2013-07-03 14:38:49 -0400 |
commit | 4148acfa9a7b1494f2d87559362c07a59f8e47f8 (patch) | |
tree | 3bc538dc147801e5369173b1633639e12474ecfd /tests/unit | |
parent | 7da828375afb20d58736bb1eb530f915c445d5b9 (diff) | |
download | jquery-ui-4148acfa9a7b1494f2d87559362c07a59f8e47f8.tar.gz jquery-ui-4148acfa9a7b1494f2d87559362c07a59f8e47f8.zip |
Tabs: Prevent default action of clicks even when disabled. Fixes #9413 - Tabs: Disabled tabs are still clickable.
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/tabs/tabs_options.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/unit/tabs/tabs_options.js b/tests/unit/tabs/tabs_options.js index 51212b8f0..a9632481e 100644 --- a/tests/unit/tabs/tabs_options.js +++ b/tests/unit/tabs/tabs_options.js @@ -144,10 +144,11 @@ test( "{ collapsible: true }", function() { }); test( "disabled", function() { - expect( 22 ); + expect( 23 ); // fully enabled by default - var element = $( "#tabs1" ).tabs(); + var event, + element = $( "#tabs1" ).tabs(); disabled( element, false ); ok( !element.tabs( "widget" ).hasClass( "ui-state-disabled" ), "after: wrapper doesn't have ui-state-disabled class" ); @@ -178,6 +179,10 @@ test( "disabled", function() { ok( !element.tabs( "widget" ).hasClass( "ui-tabs-disabled" ), "after: wrapper doesn't have ui-tabs-disabled class" ); ok( !element.tabs( "widget" ).attr( "aria-disabled" ), "after: wrapper doesn't have aria-disabled attr" ); + event = $.Event( "click" ); + element.find( ".ui-tabs-anchor" ).eq( 0 ).trigger( event ); + ok( event.isDefaultPrevented(), "click is prevented for disabled tab" ); + // enable all tabs element.tabs( "option", "disabled", [] ); disabled( element, false ); |