aboutsummaryrefslogtreecommitdiff
path: root/src/test/kotlin
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2018-01-21 20:31:15 +0100
committerRobert Jaros <rjaros@finn.pl>2018-01-21 20:31:15 +0100
commite51fb2c8cc81c7af59f9be2454f81da3825da60a (patch)
tree7694507ffa5df4cd81a087fe33956f3693438ef6 /src/test/kotlin
parentbca362ddd192de9fc96711677274b0207c7afdb7 (diff)
downloadkvision-e51fb2c8cc81c7af59f9be2454f81da3825da60a.tar.gz
kvision-e51fb2c8cc81c7af59f9be2454f81da3825da60a.tar.bz2
kvision-e51fb2c8cc81c7af59f9be2454f81da3825da60a.zip
Examples refactoring
Diffstat (limited to 'src/test/kotlin')
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/TestUtil.kt4
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/html/ImageSpec.kt4
2 files changed, 5 insertions, 3 deletions
diff --git a/src/test/kotlin/test/pl/treksoft/kvision/TestUtil.kt b/src/test/kotlin/test/pl/treksoft/kvision/TestUtil.kt
index 87c0e87f..808ca86d 100644
--- a/src/test/kotlin/test/pl/treksoft/kvision/TestUtil.kt
+++ b/src/test/kotlin/test/pl/treksoft/kvision/TestUtil.kt
@@ -57,4 +57,6 @@ interface WSpec : DomSpec {
}
}
-} \ No newline at end of file
+}
+
+external fun require(name: String): dynamic
diff --git a/src/test/kotlin/test/pl/treksoft/kvision/html/ImageSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/html/ImageSpec.kt
index 8afa7317..283847e8 100644
--- a/src/test/kotlin/test/pl/treksoft/kvision/html/ImageSpec.kt
+++ b/src/test/kotlin/test/pl/treksoft/kvision/html/ImageSpec.kt
@@ -1,10 +1,10 @@
package test.pl.treksoft.kvision.html
-import pl.treksoft.kvision.core.Img
import pl.treksoft.kvision.core.Root
import pl.treksoft.kvision.html.IMAGESHAPE
import pl.treksoft.kvision.html.Image
import test.pl.treksoft.kvision.DomSpec
+import test.pl.treksoft.kvision.require
import kotlin.browser.document
import kotlin.test.Test
import kotlin.test.assertEquals
@@ -15,7 +15,7 @@ class ImageSpec : DomSpec {
fun render() {
run {
val root = Root("test")
- val res = Img("kotlin.png")
+ val res = require("./img/placeholder.png")
val image = Image(res, "Image", true, IMAGESHAPE.ROUNDED, true)
root.add(image)
val element = document.getElementById("test")