github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

jquery / jquery-ui

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 447
    • 62
  • Source
  • Commits
  • Network (62)
  • Graphs
  • Tree: 008def0

click here to add a description

click here to add a homepage

  • Switch Branches (7)
    • bind
    • devpreview
    • formcontrols
    • master
    • menu
    • panel
    • tooltip
  • Switch Tags (16)
    • 1.8rc3
    • 1.8rc2
    • 1.8rc1
    • 1.8b1
    • 1.8a2
    • 1.8a1
    • 1.8.1
    • 1.8
    • 1.7
    • 1.6rc6
    • 1.6rc5
    • 1.6rc3
    • 1.6rc2
    • 1.6
    • 1.5.2
    • 1.5.1
  • Comments
  • Contributors
Sending Request…

The official jQuery user interface library. — Read more

  Cancel

http://jqueryui.com/

  Cancel
  • HTTP
  • Git Read-Only

This URL has Read+Write access

added tests for disabled property
carhartl (author)
Wed Apr 21 12:31:29 -0700 2010
scottgonzalez (committer)
Wed May 05 04:16:39 -0700 2010
commit  008def00bd565d0984c4
tree    dc8baacda40965a0ae90
parent  a4488aff7c62f3e2db6f
M tests/unit/tabs/tabs_options.js 33 ••••
Txt tests/unit/tabs/tabs_options.js
  • View file @ 008def0
... ...
@@ -25,7 +25,7 @@ test('collapsible', function() {
25 25
   equals($('div.ui-tabs-hide', '#tabs1').length, 3, 'all panels should be hidden');
26 26
   el.tabs('option', 'collapsible', false);
27 27
   ok(el.is(':not(.ui-tabs-collapsible)'), 'extra class "ui-tabs-collapsible" not attached');
28  
-  
  28
+
29 29
 });
30 30
 
31 31
 test('cookie', function() {
... ...
@@ -47,24 +47,37 @@ test('cookie', function() {
47 47
 
48 48
   el.tabs('select', 2);
49 49
   equals(cookie(), 2, 'cookie value updated after select');
50  
-  
  50
+
51 51
   el.tabs('destroy');
52 52
   $.cookie(cookieName, 1);
53 53
   el.tabs({ cookie: cookieObj });
54 54
   equals(cookie(), 1, 'initial cookie value, from existing cookie');
55  
-  
  55
+
56 56
   el.tabs('destroy');
57 57
   el.tabs({ cookie: cookieObj, collapsible: true });
58 58
   el.tabs('select', 0);
59 59
   equals(cookie(), -1, 'cookie value for all tabs unselected');
60  
-  
  60
+
61 61
   el.tabs('destroy');
62 62
   ok($.cookie(cookieName) === null, 'erase cookie after destroy');
63 63
 
64 64
 });
65 65
 
66 66
 test('disabled', function() {
67  
-  ok(false, "missing test - untested code is broken code.");
  67
+  expect(4);
  68
+
  69
+  el = $('#tabs1').tabs();
  70
+  same(el.tabs('option', 'disabled'), [ ], "should not disable any tab by default");
  71
+
  72
+  el.tabs('option', 'disabled', [ 1 ]);
  73
+  same(el.tabs('option', 'disabled'), [ 1 ], "should set property"); // everything else is being tested in methods module...
  74
+
  75
+  // FIXME bug... property needs to be [ 1 ], since selected tab cannot be disabled!
  76
+  el.tabs('option', 'disabled', [ 0, 1 ]);
  77
+  same(el.tabs('option', 'disabled'), [ 1 ], "should disable given tabs but not selected one"); // ...
  78
+
  79
+  el.tabs('option', 'disabled', [ ]);
  80
+  same(el.tabs('option', 'disabled'), [ ], "should not disable any tab"); // ...
68 81
 });
69 82
 
70 83
 test('event', function() {
... ...
@@ -85,10 +98,10 @@ test('panelTemplate', function() {
85 98
 
86 99
 test('selected', function() {
87 100
   expect(8);
88  
-    
  101
+
89 102
   el = $('#tabs1').tabs();
90 103
   equals(el.tabs('option', 'selected'), 0, 'should be 0 by default');
91  
-  
  104
+
92 105
   el.tabs('destroy');
93 106
   el.tabs({ selected: -1 });
94 107
   equals(el.tabs('option', 'selected'), -1, 'should be -1 for all tabs unselected');
... ...
@@ -98,15 +111,15 @@ test('selected', function() {
98 111
   el.tabs('destroy');
99 112
   el.tabs({ selected: null });
100 113
   equals(el.tabs('option', 'selected'), -1, 'should be -1 for all tabs unselected with value null (deprecated)');
101  
-  
  114
+
102 115
   el.tabs('destroy');
103 116
   el.tabs({ selected: 1 });
104 117
   equals(el.tabs('option', 'selected'), 1, 'should be specified tab');
105  
-  
  118
+
106 119
   el.tabs('destroy');
107 120
   el.tabs({ selected: 99 });
108 121
   equals(el.tabs('option', 'selected'), 0, 'selected should default to zero if given value is out of index');
109  
-  
  122
+
110 123
   el.tabs('destroy');
111 124
   el.tabs({ collapsible: true });
112 125
   el.tabs('option', 'selected', 0);

0 notes on commit 008def0

Please log in to comment.
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server