diff options
author | Robert Jaros <rjaros@finn.pl> | 2019-10-14 14:58:09 +0200 |
---|---|---|
committer | Robert Jaros <rjaros@finn.pl> | 2019-10-14 14:58:09 +0200 |
commit | 1dfbae59457b1a2dbeaa7f9cc9885e295d12e75d (patch) | |
tree | ca09bf25c5cf65e70856cf32970d04cfb1ebb101 /kvision-modules | |
parent | d0a2ba4861a50cd6e1e97c475273c416f775901b (diff) | |
download | kvision-1dfbae59457b1a2dbeaa7f9cc9885e295d12e75d.tar.gz kvision-1dfbae59457b1a2dbeaa7f9cc9885e295d12e75d.tar.bz2 kvision-1dfbae59457b1a2dbeaa7f9cc9885e295d12e75d.zip |
Some fixes of the testutils module.
Diffstat (limited to 'kvision-modules')
-rw-r--r-- | kvision-modules/kvision-testutils/build.gradle | 5 | ||||
-rw-r--r-- | kvision-modules/kvision-testutils/src/test/kotlin/pl/treksoft/kvision/test/TestUtil.kt | 23 |
2 files changed, 6 insertions, 22 deletions
diff --git a/kvision-modules/kvision-testutils/build.gradle b/kvision-modules/kvision-testutils/build.gradle index 1bf2dcf0..ad0ffd2e 100644 --- a/kvision-modules/kvision-testutils/build.gradle +++ b/kvision-modules/kvision-testutils/build.gradle @@ -13,7 +13,8 @@ jar { } task testJar(type: Jar, dependsOn: testClasses) { - baseName = "${project.archivesBaseName}-test" + baseName = "${project.archivesBaseName}" + classifier = "tests" from sourceSets.test.output } @@ -29,7 +30,7 @@ publishing { publications { mavenProject(MavenPublication) { artifact testJar { - classifier 'tests' + classifier 'tests' } } } 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 |