aboutsummaryrefslogtreecommitdiff
path: root/src/test/kotlin
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2019-03-24 00:47:11 +0100
committerRobert Jaros <rjaros@finn.pl>2019-03-24 00:47:11 +0100
commit38d8447b7024112f54a4d2a4404840cae5e4d849 (patch)
tree5715fd6ebc195390d3e41f1f288175f6baa2d74f /src/test/kotlin
parentc56ddc135c7caa9a9b62ced9425544d599e9eb69 (diff)
downloadkvision-38d8447b7024112f54a4d2a4404840cae5e4d849.tar.gz
kvision-38d8447b7024112f54a4d2a4404840cae5e4d849.tar.bz2
kvision-38d8447b7024112f54a4d2a4404840cae5e4d849.zip
Some fixes for CSS style objects.
Diffstat (limited to 'src/test/kotlin')
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/core/StyleSpec.kt13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/test/kotlin/test/pl/treksoft/kvision/core/StyleSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/core/StyleSpec.kt
index 00eb027f..bfcf5208 100644
--- a/src/test/kotlin/test/pl/treksoft/kvision/core/StyleSpec.kt
+++ b/src/test/kotlin/test/pl/treksoft/kvision/core/StyleSpec.kt
@@ -24,6 +24,7 @@ package test.pl.treksoft.kvision.core
import pl.treksoft.kvision.core.Col
import pl.treksoft.kvision.core.Color
import pl.treksoft.kvision.core.Overflow
+import pl.treksoft.kvision.core.Style
import pl.treksoft.kvision.core.Style.Companion.style
import pl.treksoft.kvision.core.Widget.Companion.widget
import pl.treksoft.kvision.panel.Root
@@ -37,7 +38,7 @@ class StyleSpec : DomSpec {
@Test
fun render() {
run {
- val root = Root("test", true) {
+ Root("test", true) {
widget {
style {
margin = 2.px
@@ -46,20 +47,20 @@ class StyleSpec : DomSpec {
}
}
}
- root.reRender()
val element = document.getElementById("test")
assertEqualsHtml(
"<style>.kv_styleclass_0 {\noverflow: scroll;\nmargin: 2px;\ncolor: silver;\n}</style><div class=\"kv_styleclass_0\"></div>",
element?.innerHTML,
"Should render correct style element"
)
+ Style.styles.clear()
}
}
@Test
fun renderCustomClass() {
run {
- val root = Root("test", true) {
+ Root("test", true) {
widget {
style("customclass") {
margin = 2.px
@@ -68,20 +69,20 @@ class StyleSpec : DomSpec {
}
}
}
- root.reRender()
val element = document.getElementById("test")
assertEqualsHtml(
"<style>.customclass {\noverflow: scroll;\nmargin: 2px;\ncolor: silver;\n}</style><div class=\"customclass\"></div>",
element?.innerHTML,
"Should render correct style element with custom class name"
)
+ Style.styles.clear()
}
}
@Test
fun renderSubclass() {
run {
- val root = Root("test", true) {
+ Root("test", true) {
widget {
style("customclass") {
margin = 2.px
@@ -93,7 +94,6 @@ class StyleSpec : DomSpec {
}
}
}
- root.reRender()
val element = document.getElementById("test")
assertEqualsHtml(
"<style>.customclass {\noverflow: scroll;\nmargin: 2px;\ncolor: silver;\n}\n" +
@@ -104,6 +104,7 @@ class StyleSpec : DomSpec {
element?.innerHTML,
"Should render correct child style class name"
)
+ Style.styles.clear()
}
}
} \ No newline at end of file