From 38d8447b7024112f54a4d2a4404840cae5e4d849 Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Sun, 24 Mar 2019 00:47:11 +0100 Subject: Some fixes for CSS style objects. --- src/test/kotlin/test/pl/treksoft/kvision/core/StyleSpec.kt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/test/kotlin') 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( "
", 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( "
", 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( "