JS: tests for KT-7357: extension functions from external KJS library couldn't be called in some cases
This commit is contained in:
@@ -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")!!)
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -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())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user