Browse Source

Introduce separate CSSDisplayTests

pull/871/head
Shagen Ogandzhanian 3 years ago
parent
commit
459cf7b37f
  1. 45
      web/core/src/jsTest/kotlin/css/CSSDisplayTests.kt

45
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
)
}
}
}
Loading…
Cancel
Save