Browse Source

web: add test for CSSSelector plus operator

pull/1504/head
Oleksandr Karpovich 3 years ago
parent
commit
d87c29a10d
  1. 21
      web/core/src/jsTest/kotlin/CssSelectorsTests.kt

21
web/core/src/jsTest/kotlin/CssSelectorsTests.kt

@ -2,6 +2,7 @@ package org.jetbrains.compose.web.core.tests
import kotlinx.browser.window
import org.jetbrains.compose.web.css.*
import org.jetbrains.compose.web.css.selectors.*
import org.jetbrains.compose.web.dom.Div
import org.jetbrains.compose.web.dom.P
import org.jetbrains.compose.web.dom.Span
@ -22,6 +23,26 @@ class CssSelectorsTests {
}
}
@Test
fun testPlusOperator() = runTest {
assertEquals("h1:hover", (selector("h1") + hover()).toString())
assertEquals(
"h1:hover:enabled",
((selector("h1") + hover()) + CSSSelector.PseudoClass.enabled).toString()
)
assertEquals(
"h1:hover",
(selector("h1") + ":hover").toString()
)
assertEquals(
"h1:hover:enabled",
((selector("h1") + hover()) + ":enabled").toString()
)
}
@Test
fun simpleDescendantsSelectorComputedStyleIsCorrect() = runTest {
composition {

Loading…
Cancel
Save