aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2011-05-10 09:15:08 -0400
committerScott González <scott.gonzalez@gmail.com>2011-05-10 09:15:08 -0400
commit36fccdda14c15f974ff6aed2315259df6da87be5 (patch)
tree5302627ff7e59300e6ffa1d727f5448122e30916 /tests
parenta205c2c8b8498f82f87a723f49c1fe746e47c667 (diff)
downloadjquery-ui-36fccdda14c15f974ff6aed2315259df6da87be5.tar.gz
jquery-ui-36fccdda14c15f974ff6aed2315259df6da87be5.zip
Tabs: Fixed cookie implementation. Fixes #7144 - Tabs: Deprecate cookie option.
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/tabs/tabs_deprecated.js54
1 files changed, 27 insertions, 27 deletions
diff --git a/tests/unit/tabs/tabs_deprecated.js b/tests/unit/tabs/tabs_deprecated.js
index 144825007..49999670f 100644
--- a/tests/unit/tabs/tabs_deprecated.js
+++ b/tests/unit/tabs/tabs_deprecated.js
@@ -1,6 +1,6 @@
(function( $ ) {
-module("tabs (deprecated): core");
+module( "tabs (deprecated): core" );
test( "panel ids", function() {
expect( 2 );
@@ -112,39 +112,39 @@ test( "tabTemplate + panelTemplate", function() {
ok( element.find( "#new" ).hasClass( "customPanel" ), "panel custom class" );
});
-test('cookie', function() {
- expect(6);
+test( "cookie", function() {
+ expect( 6 );
- el = $('#tabs1');
- var cookieName = 'tabs_test', cookieObj = { name: cookieName };
- $.cookie(cookieName, null); // blank state
- var cookie = function() {
- return parseInt($.cookie(cookieName), 10);
- };
+ var element = $( "#tabs1" ),
+ cookieName = "tabs_test",
+ cookieObj = { name: cookieName };
+ $.cookie( cookieName, null );
+ function cookie() {
+ return parseInt( $.cookie( cookieName ), 10 );
+ }
- el.tabs({ cookie: cookieObj });
- equals(cookie(), 0, 'initial cookie value');
+ element.tabs({ cookie: cookieObj });
+ equals( cookie(), 0, "initial cookie value" );
- el.tabs('destroy');
- el.tabs({ active: 1, cookie: cookieObj });
- equals(cookie(), 1, 'initial cookie value, from active property');
-
- el.tabs('option', 'active', 2);
- equals(cookie(), 2, 'cookie value updated after activating');
+ element.tabs( "destroy" );
+ element.tabs({ active: 1, cookie: cookieObj });
+ equals( cookie(), 1, "initial cookie value, from active property" );
- el.tabs('destroy');
- $.cookie(cookieName, 1);
- el.tabs({ cookie: cookieObj });
- equals(cookie(), 1, 'initial cookie value, from existing cookie');
+ element.tabs( "option", "active", 2 );
+ equals( cookie(), 2, "cookie value updated after activating" );
- el.tabs('destroy');
- el.tabs({ cookie: cookieObj, collapsible: true });
- el.tabs('option', 'active', false);
- equals(cookie(), -1, 'cookie value for all tabs unselected');
+ element.tabs( "destroy" );
+ $.cookie( cookieName, 1 );
+ element.tabs({ cookie: cookieObj });
+ equals( cookie(), 1, "initial cookie value, from existing cookie" );
- el.tabs('destroy');
- ok($.cookie(cookieName) === null, 'erase cookie after destroy');
+ element.tabs( "destroy" );
+ element.tabs({ cookie: cookieObj, collapsible: true });
+ element.tabs( "option", "active", false );
+ equals( cookie(), -1, "cookie value for all tabs unselected" );
+ element.tabs( "destroy" );
+ ok( $.cookie( cookieName ) === null, "erase cookie after destroy" );
});
asyncTest( "spinner", function() {