aboutsummaryrefslogtreecommitdiff
path: root/src/test/kotlin/test/pl/treksoft/kvision/panel/VPanelSpec.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/kotlin/test/pl/treksoft/kvision/panel/VPanelSpec.kt')
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/panel/VPanelSpec.kt27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/test/kotlin/test/pl/treksoft/kvision/panel/VPanelSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/panel/VPanelSpec.kt
new file mode 100644
index 00000000..a65b3ca9
--- /dev/null
+++ b/src/test/kotlin/test/pl/treksoft/kvision/panel/VPanelSpec.kt
@@ -0,0 +1,27 @@
+package test.pl.treksoft.kvision.panel
+
+import pl.treksoft.kvision.basic.Label
+import pl.treksoft.kvision.core.Root
+import pl.treksoft.kvision.panel.FLEXJUSTIFY
+import pl.treksoft.kvision.panel.VPanel
+import test.pl.treksoft.kvision.DomSpec
+import kotlin.browser.document
+import kotlin.test.Test
+import kotlin.test.assertEquals
+
+class VPanelSpec : DomSpec {
+
+ @Test
+ fun render() {
+ run {
+ val root = Root("test")
+ val vPanel = VPanel(justify = FLEXJUSTIFY.SPACEBETWEEN)
+ root.add(vPanel)
+ vPanel.add(Label("abc"), 1)
+ vPanel.add(Label("def"), 2)
+ vPanel.add(Label("ghi"), 3)
+ val element = document.getElementById("test")
+ assertEquals("<div style=\"display: flex; flex-direction: column; justify-content: space-between;\"><div style=\"order: 1;\"><span>abc</span></div><div style=\"order: 2;\"><span>def</span></div><div style=\"order: 3;\"><span>ghi</span></div></div>", element?.innerHTML, "Should render correct vertical panel")
+ }
+ }
+} \ No newline at end of file