aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2018-03-07 10:49:56 +0100
committerRobert Jaros <rjaros@finn.pl>2018-03-07 10:49:56 +0100
commit940ea07772eb95563978e571932a272186307cb6 (patch)
tree19f651dfa817988fabc571b9cb5748280b43123c
parent32ddb5789a4f9b644836d3a0cc2f9b14b37b5e5b (diff)
downloadkvision-940ea07772eb95563978e571932a272186307cb6.tar.gz
kvision-940ea07772eb95563978e571932a272186307cb6.tar.bz2
kvision-940ea07772eb95563978e571932a272186307cb6.zip
Unit test for icon component
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/html/IconSpec.kt25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/test/kotlin/test/pl/treksoft/kvision/html/IconSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/html/IconSpec.kt
new file mode 100644
index 00000000..5672083c
--- /dev/null
+++ b/src/test/kotlin/test/pl/treksoft/kvision/html/IconSpec.kt
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2018. Robert Jaros
+ */
+package test.pl.treksoft.kvision.html
+
+import pl.treksoft.kvision.html.Icon
+import pl.treksoft.kvision.panel.Root
+import test.pl.treksoft.kvision.DomSpec
+import kotlin.browser.document
+import kotlin.test.Test
+
+class IconSpec : DomSpec {
+
+ @Test
+ fun render() {
+ run {
+ val root = Root("test")
+ val icon = Icon("fa-check")
+ root.add(icon)
+ val element = document.getElementById("test")
+ assertEqualsHtml("<span class=\"fa fa-check\"></span>", element?.innerHTML, "Should render correct icon")
+ }
+ }
+
+}