@ -340,34 +340,30 @@ class AttributesTests {
composition {
composition {
Button ( attrs = {
Button ( attrs = {
classes ( " a " )
style {
style {
color ( Color . red )
color ( Color . red )
}
}
if ( hasValue ) value ( " buttonValue " )
if ( hasValue ) {
classes ( " b " )
value ( " buttonValue " )
}
} ) {
} ) {
Text ( " Button " )
Text ( " Button " )
}
}
}
}
assertEquals (
assertEquals (
expected = " color: red; " ,
expected = " <button class= \" a \" style= \" color: red; \" >Button</button> " ,
actual = ( root . firstChild as HTMLButtonElement ) . getAttribute ( " style " )
actual = nextChild ( ) . outerHTML
)
assertEquals (
expected = null ,
actual = ( root . firstChild as HTMLButtonElement ) . getAttribute ( " value " )
)
)
hasValue = true
hasValue = true
waitForRecompositionComplete ( )
waitForRecompositionComplete ( )
assertEquals (
assertEquals (
expected = " color: red; " ,
expected = " <button class= \" a b \" style= \" color: red; \" value= \" buttonValue \" >Button</button> " ,
actual = ( root . firstChild as HTMLButtonElement ) . getAttribute ( " style " )
actual = currentChild ( ) . outerHTML
)
assertEquals (
expected = " buttonValue " ,
actual = ( root . firstChild as HTMLButtonElement ) . getAttribute ( " value " )
)
)
}
}
}
}