diff --git a/app/src/androidTest/java/io/legado/app/JsTest.kt b/app/src/androidTest/java/io/legado/app/JsTest.kt index 62186f9f7..7e02d86c0 100644 --- a/app/src/androidTest/java/io/legado/app/JsTest.kt +++ b/app/src/androidTest/java/io/legado/app/JsTest.kt @@ -2,6 +2,7 @@ package io.legado.app import com.script.SimpleBindings import io.legado.app.constant.SCRIPT_ENGINE +import io.legado.app.data.entities.BookChapter import org.intellij.lang.annotations.Language import org.junit.Assert import org.junit.Test @@ -134,4 +135,14 @@ class JsTest { Assert.assertEquals(result1, "未知错误,请联系开发者!") } + @Test + fun chapterText() { + val chapter = BookChapter(title = "xxxyyy") + val bindings = SimpleBindings() + bindings["chapter"] = chapter + val js = "chapter.title" + val result = SCRIPT_ENGINE.eval(js, bindings) + Assert.assertEquals(result, "xxxyyy") + } + } \ No newline at end of file