Browse Source

Introduce separate test for the 3-ary border call in CSS API

pull/893/head
Shagen Ogandzhanian 3 years ago
parent
commit
eb26f07240
  1. 2
      web/core/src/jsTest/kotlin/StaticComposableTests.kt
  2. 13
      web/core/src/jsTest/kotlin/css/CSSBorderTests.kt

2
web/core/src/jsTest/kotlin/StaticComposableTests.kt

@ -1,8 +1,6 @@
package org.jetbrains.compose.web.core.tests
import org.jetbrains.compose.web.css.Color
import org.jetbrains.compose.web.css.Position
import org.jetbrains.compose.web.css.border
import org.jetbrains.compose.web.css.bottom
import org.jetbrains.compose.web.css.color
import org.jetbrains.compose.web.css.left

13
web/core/src/jsTest/kotlin/css/CSSBorderTests.kt

@ -5,6 +5,7 @@
package org.jetbrains.compose.web.core.tests.css
import kotlinx.browser.window
import org.jetbrains.compose.web.core.tests.runTest
import org.jetbrains.compose.web.css.*
import org.jetbrains.compose.web.dom.Div
@ -23,13 +24,21 @@ class CSSBorderTests {
}
assertEquals("1px solid red", (root.children[0] as HTMLElement).style.border)
root.children[1]?.let {
val el = it.unsafeCast<HTMLElement>()
(root.children[1] as HTMLElement).let { el ->
assertEquals("green", el.style.getPropertyValue("border-color"))
assertEquals("3px", el.style.getPropertyValue("border-width"))
}
}
@Test
fun borderThreeValues() = runTest {
composition {
Div({ style { border(3.px, LineStyle.Dotted, Color("green")) } })
}
assertEquals("3px dotted green", (root.children[0] as HTMLElement).style.border)
}
@Test
fun borderRadius() = runTest {
composition {

Loading…
Cancel
Save