aboutsummaryrefslogtreecommitdiff
path: root/kvision-modules/kvision-testutils/src/test/kotlin/pl
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2019-10-14 14:58:09 +0200
committerRobert Jaros <rjaros@finn.pl>2019-10-14 14:58:09 +0200
commit1dfbae59457b1a2dbeaa7f9cc9885e295d12e75d (patch)
treeca09bf25c5cf65e70856cf32970d04cfb1ebb101 /kvision-modules/kvision-testutils/src/test/kotlin/pl
parentd0a2ba4861a50cd6e1e97c475273c416f775901b (diff)
downloadkvision-1dfbae59457b1a2dbeaa7f9cc9885e295d12e75d.tar.gz
kvision-1dfbae59457b1a2dbeaa7f9cc9885e295d12e75d.tar.bz2
kvision-1dfbae59457b1a2dbeaa7f9cc9885e295d12e75d.zip
Some fixes of the testutils module.
Diffstat (limited to 'kvision-modules/kvision-testutils/src/test/kotlin/pl')
-rw-r--r--kvision-modules/kvision-testutils/src/test/kotlin/pl/treksoft/kvision/test/TestUtil.kt23
1 files changed, 3 insertions, 20 deletions
diff --git a/kvision-modules/kvision-testutils/src/test/kotlin/pl/treksoft/kvision/test/TestUtil.kt b/kvision-modules/kvision-testutils/src/test/kotlin/pl/treksoft/kvision/test/TestUtil.kt
index c32faa70..ca522469 100644
--- a/kvision-modules/kvision-testutils/src/test/kotlin/pl/treksoft/kvision/test/TestUtil.kt
+++ b/kvision-modules/kvision-testutils/src/test/kotlin/pl/treksoft/kvision/test/TestUtil.kt
@@ -21,9 +21,7 @@
*/
package pl.treksoft.kvision.test
-import org.w3c.dom.Element
import pl.treksoft.jquery.jQuery
-import pl.treksoft.kvision.core.Widget
import pl.treksoft.kvision.panel.Root
import kotlin.browser.document
import kotlin.test.assertEquals
@@ -53,9 +51,11 @@ interface SimpleSpec : TestSpec {
interface DomSpec : TestSpec {
+ fun getId() = "test"
+
override fun beforeTest() {
val fixture = "<div style=\"display: none\" id=\"pretest\">" +
- "<div id=\"test\"></div></div>"
+ "<div id=\"${getId()}\"></div></div>"
document.body?.insertAdjacentHTML("afterbegin", fixture)
}
@@ -81,20 +81,3 @@ interface DomSpec : TestSpec {
}
}
}
-
-interface WSpec : DomSpec {
-
- fun runW(code: (widget: Widget, element: Element?) -> Unit) {
- run {
- val root = Root("test", fixed = true)
- val widget = Widget()
- widget.id = "test_id"
- root.add(widget)
- val element = document.getElementById("test_id")
- code(widget, element)
- }
- }
-
-}
-
-external fun require(name: String): dynamic