@@ -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 commit comments