aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/tabs
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2011-05-09 15:04:01 -0400
committerScott González <scott.gonzalez@gmail.com>2011-05-09 15:04:01 -0400
commit7157af2550b1b26fb71a7fac17ea67f36f117f7e (patch)
treedad62a1cb83d8986846575d902e79d45b17d2002 /tests/unit/tabs
parent9549686cb35b877740aca388286d71ad04311a2d (diff)
downloadjquery-ui-7157af2550b1b26fb71a7fac17ea67f36f117f7e.tar.gz
jquery-ui-7157af2550b1b26fb71a7fac17ea67f36f117f7e.zip
Tabs: Added tests for cache option. Fixes #7131 - Tabs: Add beforeload event; deprecate ajaxOptions and cache options.
Diffstat (limited to 'tests/unit/tabs')
-rw-r--r--tests/unit/tabs/tabs_deprecated.js30
1 files changed, 28 insertions, 2 deletions
diff --git a/tests/unit/tabs/tabs_deprecated.js b/tests/unit/tabs/tabs_deprecated.js
index e5f7b7568..49e89b7a0 100644
--- a/tests/unit/tabs/tabs_deprecated.js
+++ b/tests/unit/tabs/tabs_deprecated.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() {