diff --git a/web/core/src/jsTest/kotlin/css/CSSDisplayTests.kt b/web/core/src/jsTest/kotlin/css/CSSDisplayTests.kt new file mode 100644 index 0000000000..33ba913a13 --- /dev/null +++ b/web/core/src/jsTest/kotlin/css/CSSDisplayTests.kt @@ -0,0 +1,45 @@ +/* + * 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.runTest +import org.jetbrains.compose.web.core.tests.values +import org.jetbrains.compose.web.css.DisplayStyle +import org.jetbrains.compose.web.css.display +import org.jetbrains.compose.web.css.value +import org.jetbrains.compose.web.dom.Div +import org.w3c.dom.HTMLElement +import org.w3c.dom.get +import kotlin.test.Test +import kotlin.test.assertEquals + +class CSSDisplayTests { + + @Test + fun stylesDisplay() = runTest { + val enumValues = DisplayStyle.values() + + composition { + enumValues.forEach { displayStyle -> + Div( + { + style { + display(displayStyle) + } + } + ) + } + } + + enumValues.forEachIndexed { index, displayStyle -> + assertEquals( + displayStyle.value, + (root.children[index] as HTMLElement).style.display + ) + } + } + +} \ No newline at end of file