Skip to content
Permalink
Browse files

Tabs: Added tests for cache option. Fixes #7131 - Tabs: Add beforeloa…

…d event; deprecate ajaxOptions and cache options.
  • Loading branch information...
scottgonzalez committed May 9, 2011
1 parent 9549686 commit 7157af2550b1b26fb71a7fac17ea67f36f117f7e
Showing with 29 additions and 3 deletions.
  1. +28 −2 tests/unit/tabs/tabs_deprecated.js
  2. +1 −1 ui/jquery.ui.tabs.js
@@ -41,8 +41,34 @@ asyncTest( "ajaxOptions", function() {
element.tabs( "option", "active", 2 );
});

test('cache', function() {
ok(false, "missing test - untested code is broken code.");
asyncTest( "cache", function() {
expect( 5 );

var element = $( "#tabs2" ).tabs({
cache: true
});
element.one( "tabsshow", function( event, ui ) {
tabs_state( element, 0, 0, 1, 0, 0 );
});
element.one( "tabsload", function( event, ui ) {
ok( true, "tabsload" );

setTimeout(function() {
element.tabs( "option", "active", 0 );
tabs_state( element, 1, 0, 0, 0, 0 );

element.one( "tabsshow", function( event, ui ) {
tabs_state( element, 0, 0, 1, 0, 0 );
});
element.one( "tabsload", function( event, ui ) {
ok( false, "should be cached" );
});
element.tabs( "option", "active", 2 );
start();
}, 1 );
});
element.tabs( "option", "active", 2 );
tabs_state( element, 0, 0, 1, 0, 0 );
});

test( "idPrefix", function() {
@@ -705,7 +705,7 @@ if ( $.uiBackCompat !== false ) {
}
});

ui.jqXHR.success( function() {
ui.jqXHR.success(function() {
if ( self.options.cache ) {
$.data( ui.tab[ 0 ], "cache.tabs", true );
}

0 comments on commit 7157af2

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