From c13d0441dddf31ef019333fd16378b3fc56003a4 Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Sat, 9 Mar 2019 02:51:11 +0100 Subject: Unary plus support for DSL builders in the Tag class. --- .../kotlin/test/pl/treksoft/kvision/html/TagSpec.kt | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/test/kotlin') 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 h1" + } + root.add(tag) + val element = document.getElementById("test") + assertEqualsHtml( + "

This is h1

", + element?.innerHTML, + "Should render correct html tag with children" + ) + } + } +} -- cgit