diff --git a/web/core/src/jsTest/kotlin/StaticComposableTests.kt b/web/core/src/jsTest/kotlin/StaticComposableTests.kt index 720f287357..865982678d 100644 --- a/web/core/src/jsTest/kotlin/StaticComposableTests.kt +++ b/web/core/src/jsTest/kotlin/StaticComposableTests.kt @@ -257,24 +257,6 @@ class StaticComposableTests { assertEquals("flex-shrink: 0.6;", (root.children[3] as HTMLElement).style.cssText) } - @Test - fun stylesWidth() { - val root = "div".asHtmlElement() - renderComposable( - root = root - ) { - Div( - { - style { - width(100.px) - } - } - ) - } - - assertEquals("width: 100px;", (root.children[0] as HTMLElement).style.cssText) - } - @Test fun stylesBorderRadius() { val root = "div".asHtmlElement() @@ -424,24 +406,6 @@ class StaticComposableTests { assertEquals("right: 100%;", (root.children[1] as HTMLElement).style.cssText) } - @Test - fun stylesHeight() { - val root = "div".asHtmlElement() - renderComposable( - root = root - ) { - Div( - { - style { - height(100.px) - } - } - ) - } - - assertEquals("height: 100px;", (root.children[0] as HTMLElement).style.cssText) - } - @Test fun stylesDisplay() { val root = "div".asHtmlElement() diff --git a/web/core/src/jsTest/kotlin/css/CSSBoxTests.kt b/web/core/src/jsTest/kotlin/css/CSSBoxTests.kt new file mode 100644 index 0000000000..19b53299d6 --- /dev/null +++ b/web/core/src/jsTest/kotlin/css/CSSBoxTests.kt @@ -0,0 +1,52 @@ +/* + * Copyright 2020-2021 JetBrains s.r.o. and respective authors and developers. + * Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file. + */ + +package org.jetbrains.compose.web.core.tests.css + +import org.jetbrains.compose.web.core.tests.asHtmlElement +import org.jetbrains.compose.web.core.tests.runTest +import org.jetbrains.compose.web.css.height +import org.jetbrains.compose.web.css.px +import org.jetbrains.compose.web.css.width +import org.jetbrains.compose.web.dom.Div +import org.jetbrains.compose.web.renderComposable +import org.w3c.dom.HTMLElement +import org.w3c.dom.get +import kotlin.test.Test +import kotlin.test.assertEquals + +class CSSBoxTests { + + @Test + fun stylesWidth() = runTest { + composition { + Div( + { + style { + width(100.px) + } + } + ) + } + + assertEquals("100px", (root.children[0] as HTMLElement).style.width) + } + + @Test + fun stylesHeight() = runTest { + composition { + Div( + { + style { + height(90.px) + } + } + ) + } + + assertEquals("90px", (root.children[0] as HTMLElement).style.height) + } + +} \ No newline at end of file