From d87c29a10d521849818b8eb988d77765b08d3ba6 Mon Sep 17 00:00:00 2001 From: Oleksandr Karpovich Date: Tue, 30 Nov 2021 14:15:09 +0100 Subject: [PATCH] web: add test for CSSSelector plus operator --- .../src/jsTest/kotlin/CssSelectorsTests.kt | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) 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 {