@@ -10,7 +10,7 @@ test( "disabled, explicit value", function() {
10
10
11
11
var element = $ ( "#button" ) . button ( { disabled : false } ) ;
12
12
deepEqual ( element . button ( "option" , "disabled" ) , false , "disabled option set to false" ) ;
13
- deepEqual ( element . prop ( "disabled" ) , false , "element is disabled " ) ;
13
+ deepEqual ( element . prop ( "disabled" ) , false , "Disabled property is false " ) ;
14
14
15
15
ok ( ! element . button ( "widget" ) . hasClass ( "ui-state-disabled" ) , "element gets ui-state-disabled" ) ;
16
16
ok ( ! element . button ( "widget" ) . hasClass ( "ui-button-disabled" ) , "element gets ui-button-disabled" ) ;
@@ -22,9 +22,11 @@ test( "disabled, explicit value", function() {
22
22
ok ( element . button ( "widget" ) . hasClass ( "ui-button-disabled" ) , "element gets ui-button-disabled" ) ;
23
23
24
24
deepEqual ( element . button ( "option" , "disabled" ) , true , "disabled option set to true" ) ;
25
- deepEqual ( element . prop ( "disabled" ) , true , "element is not disabled " ) ;
25
+ deepEqual ( element . prop ( "disabled" ) , true , "Disabled property is set " ) ;
26
26
} ) ;
27
27
28
+ // We are testing the default here because the default null is a special value which means to check
29
+ // the DOM, so we need to make sure this happens correctly
28
30
test ( "disabled, null" , function ( ) {
29
31
expect ( 2 ) ;
30
32
$ ( "#button" ) . button ( { disabled : null } ) ;
@@ -33,18 +35,20 @@ test( "disabled, null", function() {
33
35
strictEqual ( $ ( "#button" ) . prop ( "disabled" ) , false , "element is disabled" ) ;
34
36
} ) ;
35
37
36
- test ( "showLabel false without icon" , function ( ) {
38
+ test ( "showLabel, false, without icon" , function ( ) {
37
39
expect ( 1 ) ;
38
- $ ( "#button" ) . button ( {
40
+
41
+ var button = $ ( "#button" )
42
+ button . button ( {
39
43
showLabel : false
40
44
} ) ;
41
- strictEqual ( $ ( "# button" ) . is ( ":ui-button.ui-corner-all.ui-widget" ) , true ,
45
+ strictEqual ( button . is ( ":ui-button.ui-corner-all.ui-widget" ) , true ,
42
46
"Button has correct classes" ) ;
43
47
44
- $ ( "# button" ) . button ( "destroy" ) ;
48
+ button . button ( "destroy" ) ;
45
49
} ) ;
46
50
47
- test ( "showLabel false with icon" , function ( ) {
51
+ test ( "showLabel, false, with icon" , function ( ) {
48
52
expect ( 1 ) ;
49
53
$ ( "#button" ) . button ( {
50
54
showLabel : false ,
@@ -64,7 +68,7 @@ test( "label, default", function() {
64
68
$ ( "#button" ) . button ( "destroy" ) ;
65
69
} ) ;
66
70
67
- test ( "label" , function ( ) {
71
+ test ( "label, explicit value " , function ( ) {
68
72
expect ( 2 ) ;
69
73
$ ( "#button" ) . button ( {
70
74
label : "xxx"
@@ -75,13 +79,13 @@ test( "label", function() {
75
79
$ ( "#button" ) . button ( "destroy" ) ;
76
80
} ) ;
77
81
78
- test ( "label default with input type submit" , function ( ) {
82
+ test ( "label, default, with input type submit" , function ( ) {
79
83
expect ( 2 ) ;
80
84
deepEqual ( $ ( "#submit" ) . button ( ) . val ( ) , "Label" ) ;
81
85
deepEqual ( $ ( "#submit" ) . button ( "option" , "label" ) , "Label" ) ;
82
86
} ) ;
83
87
84
- test ( "label with input type submit" , function ( ) {
88
+ test ( "label, explicit value, with input type submit" , function ( ) {
85
89
expect ( 2 ) ;
86
90
var label = $ ( "#submit" ) . button ( {
87
91
label : "xxx"
@@ -90,7 +94,7 @@ test( "label with input type submit", function() {
90
94
deepEqual ( $ ( "#submit" ) . button ( "option" , "label" ) , "xxx" ) ;
91
95
} ) ;
92
96
93
- test ( "icons " , function ( ) {
97
+ test ( "icon " , function ( ) {
94
98
expect ( 1 ) ;
95
99
$ ( "#button" ) . button ( {
96
100
showLabel : false ,
0 commit comments