@@ -13,4 +13,40 @@ test("destroy", function() {
13
13
} ) ;
14
14
} ) ;
15
15
16
+ test ( "refresh: Ensure disabled state is preserved correctly." , function ( ) {
17
+ expect ( 8 ) ;
18
+
19
+ var element = $ ( "<a href='#'></a>" ) ;
20
+ element . button ( { disabled : true } ) . button ( "refresh" ) ;
21
+ ok ( element . button ( "option" , "disabled" ) , "Anchor button should remain disabled after refresh" ) ; //See #8237
22
+
23
+ element = $ ( "<div></div>" ) ;
24
+ element . button ( { disabled : true } ) . button ( "refresh" ) ;
25
+ ok ( element . button ( "option" , "disabled" ) , "<div> buttons should remain disabled after refresh" ) ;
26
+
27
+ element = $ ( "<button></button>" ) ;
28
+ element . button ( { disabled : true } ) . button ( "refresh" ) ;
29
+ ok ( element . button ( "option" , "disabled" ) , "<button> should remain disabled after refresh" ) ;
30
+
31
+ element = $ ( "<input type='checkbox'>" ) ;
32
+ element . button ( { disabled : true } ) . button ( "refresh" ) ;
33
+ ok ( element . button ( "option" , "disabled" ) , "Checkboxes should remain disabled after refresh" ) ;
34
+
35
+ element = $ ( "<input type='radio'>" ) ;
36
+ element . button ( { disabled : true } ) . button ( "refresh" ) ;
37
+ ok ( element . button ( "option" , "disabled" ) , "Radio buttons should remain disabled after refresh" ) ;
38
+
39
+ element = $ ( "<button></button>" ) ;
40
+ element . button ( { disabled : true } ) . prop ( "disabled" , false ) . button ( "refresh" ) ;
41
+ ok ( ! element . button ( "option" , "disabled" ) , "Changing a <button>'s disabled property should update the state after refresh." ) ; //See #8828
42
+
43
+ element = $ ( "<input type='checkbox'>" ) ;
44
+ element . button ( { disabled : true } ) . prop ( "disabled" , false ) . button ( "refresh" ) ;
45
+ ok ( ! element . button ( "option" , "disabled" ) , "Changing a checkbox's disabled property should update the state after refresh." ) ;
46
+
47
+ element = $ ( "<input type='radio'>" ) ;
48
+ element . button ( { disabled : true } ) . prop ( "disabled" , false ) . button ( "refresh" ) ;
49
+ ok ( ! element . button ( "option" , "disabled" ) , "Changing a radio button's disabled property should update the state after refresh." ) ;
50
+ } ) ;
51
+
16
52
} ) ( jQuery ) ;
0 commit comments