aboutsummaryrefslogtreecommitdiff
path: root/kvision-modules/kvision-testutils
diff options
context:
space:
mode:
Diffstat (limited to 'kvision-modules/kvision-testutils')
-rw-r--r--kvision-modules/kvision-testutils/build.gradle5
-rw-r--r--kvision-modules/kvision-testutils/src/test/kotlin/pl/treksoft/kvision/test/TestUtil.kt23
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