@@ -18,7 +18,7 @@ test('destroy', function() {
18
18
} ) ;
19
19
20
20
test ( 'enable' , function ( ) {
21
- expect ( 8 ) ;
21
+ expect ( 12 ) ;
22
22
23
23
el = $ ( '#tabs1' ) . tabs ( { disabled : [ 0 , 1 ] } ) ;
24
24
el . tabs ( "enable" , 1 ) ;
@@ -31,6 +31,18 @@ test('enable', function() {
31
31
ok ( ! $ ( 'li.ui-state-disabled' , el ) . length , 'enable all' ) ;
32
32
same ( el . tabs ( 'option' , 'disabled' ) , false , 'update property' ) ;
33
33
34
+ // enable one tab
35
+ el . tabs ( { disabled : true } ) ;
36
+ el . tabs ( "enable" , 1 ) ;
37
+ ok ( $ ( 'li:eq(1)' , el ) . is ( ':not(.ui-state-disabled)' ) , 'remove class from li' ) ;
38
+ same ( el . tabs ( 'option' , 'disabled' ) , [ 0 , 2 ] , 'update property' ) ;
39
+
40
+ // all tabs already enabled
41
+ el . tabs ( { disabled : false } ) ;
42
+ el . tabs ( "enable" , 1 ) ;
43
+ ok ( ! $ ( 'li.ui-state-disabled' , el ) . length , 'enable all' ) ;
44
+ same ( el . tabs ( 'option' , 'disabled' ) , false , 'update property' ) ;
45
+
34
46
el . tabs ( 'destroy' ) ;
35
47
// enable all tabs one by one
36
48
el . tabs ( { disabled : [ 1 , 2 ] } ) ;
@@ -43,7 +55,7 @@ test('enable', function() {
43
55
} ) ;
44
56
45
57
test ( 'disable' , function ( ) {
46
- expect ( 12 ) ;
58
+ expect ( 14 ) ;
47
59
48
60
// normal
49
61
el = $ ( '#tabs1' ) . tabs ( ) ;
@@ -61,6 +73,12 @@ test('disable', function() {
61
73
same ( $ ( 'li.ui-state-disabled' , el ) . length , 3 , 'disable all' ) ;
62
74
same ( el . tabs ( 'option' , 'disabled' ) , true , 'set to true' ) ;
63
75
76
+ // all tabs already disabled
77
+ el . tabs ( { disabled : true } ) ;
78
+ el . tabs ( "disable" , 1 ) ;
79
+ ok ( $ ( 'li.ui-state-disabled' , el ) . length , 'disable all' ) ;
80
+ same ( el . tabs ( 'option' , 'disabled' ) , true , 'set to true' ) ;
81
+
64
82
el . tabs ( "destroy" ) ;
65
83
// disable all tabs one by one
66
84
el . tabs ( ) ;
0 commit comments