JS: tests for KT-7357: extension functions from external KJS library couldn't be called in some cases

This commit is contained in:
Michael Nedzelsky
2015-04-09 13:06:15 +03:00
parent 66aa15f470
commit 6842c98285
8 changed files with 73 additions and 2 deletions
@@ -3,6 +3,7 @@ package sample
import kotlin.Pair
import kotlin.browser.document
import library.sample.*
import kotlin.js.Date
fun myApp() {
val element = document.getElementById("foo")
@@ -11,6 +12,7 @@ fun myApp() {
val x = pairAdd(p)
val y = pairMul(p)
val z = IntHolder(100).value
element.appendChild(document.createTextNode("x=$x y=$y z=$z")!!)
val u = Date().extFun()
element.appendChild(document.createTextNode("x=$x y=$y z=$z u=$u")!!)
}
}
@@ -17,6 +17,6 @@ open class SampleTest {
val foo = driver.findElement(By.id("foo"))!!
val text = foo.getText() ?: ""
println("Found $foo with text '$text'")
assertEquals("x=30 y=200 z=100", text.trim())
assertEquals("x=30 y=200 z=100 u=1000", text.trim())
}
}