@@ -1090,18 +1090,36 @@ new Test.Unit.Runner({
10901090
10911091 testElementWriteAttributeWithBooleans : function ( ) {
10921092 var input = $ ( 'write_attribute_input' ) ,
1093- select = $ ( 'write_attribute_select' ) ,
1094- checkbox = $ ( 'write_attribute_checkbox' ) ,
1095- checkedCheckbox = $ ( 'write_attribute_checked_checkbox' ) ;
1093+ select = $ ( 'write_attribute_select' ) ;
10961094 this . assert ( input . writeAttribute ( 'readonly' ) . hasAttribute ( 'readonly' ) ) ;
10971095 this . assert ( ! input . writeAttribute ( 'readonly' , false ) . hasAttribute ( 'readonly' ) ) ;
10981096 this . assert ( input . writeAttribute ( 'readonly' , true ) . hasAttribute ( 'readonly' ) ) ;
10991097 this . assert ( ! input . writeAttribute ( 'readonly' , null ) . hasAttribute ( 'readonly' ) ) ;
11001098 this . assert ( input . writeAttribute ( 'readonly' , 'readonly' ) . hasAttribute ( 'readonly' ) ) ;
11011099 this . assert ( select . writeAttribute ( 'multiple' ) . hasAttribute ( 'multiple' ) ) ;
11021100 this . assert ( input . writeAttribute ( 'disabled' ) . hasAttribute ( 'disabled' ) ) ;
1101+ } ,
1102+ testElementWriteAttributeForCheckbox : function ( ) {
1103+ var checkbox = $ ( 'write_attribute_checkbox' ) ,
1104+ checkedCheckbox = $ ( 'write_attribute_checked_checkbox' ) ;
11031105 this . assert ( checkbox . writeAttribute ( 'checked' ) . checked ) ;
1106+ this . assert ( checkbox . writeAttribute ( 'checked' ) . hasAttribute ( 'checked' ) ) ;
1107+ this . assertEqual ( 'checked' , checkbox . writeAttribute ( 'checked' ) . getAttribute ( 'checked' ) ) ;
1108+ this . assert ( ! checkbox . writeAttribute ( 'checked' ) . hasAttribute ( 'undefined' ) ) ;
1109+ this . assert ( checkbox . writeAttribute ( 'checked' , true ) . checked ) ;
1110+ this . assert ( checkbox . writeAttribute ( 'checked' , true ) . hasAttribute ( 'checked' ) ) ;
1111+ this . assert ( checkbox . writeAttribute ( 'checked' , 'checked' ) . checked ) ;
1112+ this . assert ( checkbox . writeAttribute ( 'checked' , 'checked' ) . hasAttribute ( 'checked' ) ) ;
1113+ this . assert ( ! checkbox . writeAttribute ( 'checked' , null ) . checked ) ;
1114+ this . assert ( ! checkbox . writeAttribute ( 'checked' , null ) . hasAttribute ( 'checked' ) ) ;
1115+ this . assert ( ! checkbox . writeAttribute ( 'checked' , true ) . hasAttribute ( 'undefined' ) ) ;
11041116 this . assert ( ! checkedCheckbox . writeAttribute ( 'checked' , false ) . checked ) ;
1117+ this . assert ( ! checkbox . writeAttribute ( 'checked' , false ) . hasAttribute ( 'checked' ) ) ;
1118+ } ,
1119+ testElementWriteAttributeForStyle : function ( ) {
1120+ var element = Element . extend ( document . body . appendChild ( document . createElement ( 'p' ) ) ) ;
1121+ this . assert ( element . writeAttribute ( 'style' , 'color: red' ) . hasAttribute ( 'style' ) ) ;
1122+ this . assert ( ! element . writeAttribute ( 'style' , 'color: red' ) . hasAttribute ( 'undefined' ) ) ;
11051123 } ,
11061124
11071125 testElementWriteAttributeWithIssues : function ( ) {
0 commit comments