aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2018-03-23 12:41:39 +0100
committerRobert Jaros <rjaros@finn.pl>2018-03-23 12:41:39 +0100
commit0041051ee910aa90b917309fb5cc5d7cd60176de (patch)
tree5106d6ed6de5021d2ad99ff8d2b112c79693c1e9 /src/test
parent4f9d464f69e1ca1a793710fa47808df55cdea749 (diff)
downloadkvision-0041051ee910aa90b917309fb5cc5d7cd60176de.tar.gz
kvision-0041051ee910aa90b917309fb5cc5d7cd60176de.tar.bz2
kvision-0041051ee910aa90b917309fb5cc5d7cd60176de.zip
Support fo toolbar and button group componenets.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/toolbar/ButtonGroupSpec.kt39
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/toolbar/ToolbarSpec.kt29
2 files changed, 68 insertions, 0 deletions
diff --git a/src/test/kotlin/test/pl/treksoft/kvision/toolbar/ButtonGroupSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/toolbar/ButtonGroupSpec.kt
new file mode 100644
index 00000000..c1695d74
--- /dev/null
+++ b/src/test/kotlin/test/pl/treksoft/kvision/toolbar/ButtonGroupSpec.kt
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2018. Robert Jaros
+ */
+package test.pl.treksoft.kvision.toolbar
+
+import pl.treksoft.kvision.panel.Root
+import pl.treksoft.kvision.toolbar.ButtonGroup
+import pl.treksoft.kvision.toolbar.ButtonGroupSize
+import pl.treksoft.kvision.toolbar.ButtonGroupStyle
+import test.pl.treksoft.kvision.DomSpec
+import kotlin.browser.document
+import kotlin.test.Test
+
+class ButtonGroupSpec : DomSpec {
+
+ @Test
+ fun render() {
+ run {
+ val root = Root("test", true)
+ val group = ButtonGroup()
+ root.add(group)
+ val element = document.getElementById("test")
+ assertEqualsHtml(
+ "<div class=\"btn-group\" role=\"group\"></div>",
+ element?.innerHTML,
+ "Should render correct button group"
+ )
+ group.size = ButtonGroupSize.LARGE
+ group.style = ButtonGroupStyle.JUSTIFIED
+ assertEqualsHtml(
+ "<div class=\"btn-group btn-group-lg btn-group-justified\" role=\"group\"></div>",
+ element?.innerHTML,
+ "Should render correct button group with large and justified buttons"
+ )
+
+ }
+ }
+
+}
diff --git a/src/test/kotlin/test/pl/treksoft/kvision/toolbar/ToolbarSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/toolbar/ToolbarSpec.kt
new file mode 100644
index 00000000..5363640a
--- /dev/null
+++ b/src/test/kotlin/test/pl/treksoft/kvision/toolbar/ToolbarSpec.kt
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2018. Robert Jaros
+ */
+package test.pl.treksoft.kvision.toolbar
+
+import pl.treksoft.kvision.panel.Root
+import pl.treksoft.kvision.toolbar.Toolbar
+import test.pl.treksoft.kvision.DomSpec
+import kotlin.browser.document
+import kotlin.test.Test
+
+class ToolbarSpec : DomSpec {
+
+ @Test
+ fun render() {
+ run {
+ val root = Root("test", true)
+ val toolbar = Toolbar()
+ root.add(toolbar)
+ val element = document.getElementById("test")
+ assertEqualsHtml(
+ "<div class=\"btn-toolbar\" role=\"toolbar\"></div>",
+ element?.innerHTML,
+ "Should render correct toolbar"
+ )
+ }
+ }
+
+}