(function( $ ) { module( "tabs: methods" ); test( "destroy", function() { domEqual( "#tabs1", function() { $( "#tabs1" ).tabs().tabs( "destroy" ); }); }); test( "enable", function() { expect( 8 ); var element = $( "#tabs1" ).tabs({ disabled: true }); tabs_disabled( element, true ); element.tabs( "enable" ); tabs_disabled( element, false ); element.tabs( "destroy" ); element.tabs({ disabled: [ 0, 1 ] }); tabs_disabled( element, [ 0, 1 ] ); element.tabs( "enable" ); tabs_disabled( element, false ); }); test( "enable( index )", function() { expect( 10 ); var element = $( "#tabs1" ).tabs({ disabled: true }); tabs_disabled( element, true ); // fully disabled -> partially disabled element.tabs( "enable", 1 ); tabs_disabled( element, [ 0, 2 ] ); // partially disabled -> partially disabled element.tabs( "enable", 2 ); tabs_disabled( element, [ 0 ] ); // already enabled tab, no change element.tabs( "enable", 2 ); tabs_disabled( element, [ 0 ] ); // partially disabled -> fully enabled element.tabs( "enable", 0 ); tabs_disabled( element, false ); }); test( "disable", function() { expect( 8 ); var element = $( "#tabs1" ).tabs({ disabled: false }); tabs_disabled( element, false ); element.tabs( "disable" ); tabs_disabled( element, true ); element.tabs( "destroy" ); element.tabs({ disabled: [ 0, 1 ] }); tabs_disabled( element, [ 0, 1 ] ); element.tabs( "disable" ); tabs_disabled( element, true ); }); test( "disable( index )", function() { expect( 10 ); var element = $( "#tabs1" ).tabs({ disabled: false }); tabs_disabled( element, false ); // fully enabled -> partially disabled element.tabs( "disable", 1 ); tabs_disabled( element, [ 1 ] ); // partially disabled -> partially disabled element.tabs( "disable", 2 ); tabs_disabled( element, [ 1, 2 ] ); // already disabled tab, no change element.tabs( "disable", 2 ); tabs_disabled( element, [ 1, 2 ] ); // partially disabled -> fully disabled element.tabs( "disable", 0 ); tabs_disabled( element, true ); }); test( "refresh", function() { expect( 27 ); var element = $( "#tabs1" ).tabs(); tabs_state( element, 1, 0, 0 ); tabs_disabled( element, false ); // disable tab via markup element.find( ".ui-tabs-nav li" ).eq( 1 ).addClass( "ui-state-disabled" ); element.tabs( "refresh" ); tabs_state( element, 1, 0, 0 ); tabs_disabled( element, [ 1 ] ); // add remote tab element.find( ".ui-tabs-nav" ).append( "