aboutsummaryrefslogtreecommitdiff
path: root/src/test/kotlin
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2019-03-09 02:51:11 +0100
committerRobert Jaros <rjaros@finn.pl>2019-03-09 02:51:11 +0100
commitc13d0441dddf31ef019333fd16378b3fc56003a4 (patch)
treecc75ce1643c73ce4f8675876410ba9118f5969ef /src/test/kotlin
parent74439213455a192f82751cfc1b98878620d815b9 (diff)
downloadkvision-c13d0441dddf31ef019333fd16378b3fc56003a4.tar.gz
kvision-c13d0441dddf31ef019333fd16378b3fc56003a4.tar.bz2
kvision-c13d0441dddf31ef019333fd16378b3fc56003a4.zip
Unary plus support for DSL builders in the Tag class.
Diffstat (limited to 'src/test/kotlin')
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/html/TagSpec.kt19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/test/kotlin/test/pl/treksoft/kvision/html/TagSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/html/TagSpec.kt
index 91c6df81..29a5c079 100644
--- a/src/test/kotlin/test/pl/treksoft/kvision/html/TagSpec.kt
+++ b/src/test/kotlin/test/pl/treksoft/kvision/html/TagSpec.kt
@@ -78,4 +78,21 @@ class TagSpec : DomSpec {
)
}
}
-} \ No newline at end of file
+
+ @Test
+ fun renderUnaryPlus() {
+ run {
+ val root = Root("test", true)
+ val tag = Tag(TAG.H1, rich = true) {
+ +"This is <b>h1</b>"
+ }
+ root.add(tag)
+ val element = document.getElementById("test")
+ assertEqualsHtml(
+ "<h1><span>This is <b>h1</b></span></h1>",
+ element?.innerHTML,
+ "Should render correct html tag with children"
+ )
+ }
+ }
+}