diff --git a/web/core/src/jsTest/kotlin/CssSelectorsTests.kt b/web/core/src/jsTest/kotlin/CssSelectorsTests.kt index 13167bc1f6..6ae98806c1 100644 --- a/web/core/src/jsTest/kotlin/CssSelectorsTests.kt +++ b/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 {