Play Framework 2.5 で ScalaJs クロスビルド プロジェクトを使用しようとしています。Client.scala のテストを実行しようとしているときに問題に直面しています。私が得ているエラーは -
原因: TypeError: null のメソッド「appendChild」を呼び出せません。
クライアント スニペット
@JSExport
object DashboardClient extends js.JSApp {
@JSExport
def main(): Unit = {
val dashboard = new Dashboard
dom.document.getElementById("bodyContent").appendChild(dashboard.bodyFrag.render)
}
この bodyFrag は別のクラス内にあります
def bodyFrag =
div(
div(
`class` := "row border-bottom",
div(
`class` := "col-md-12",
div(
`class` := "col-md-2 image-alignment",
img(width := "161", src := "/assets/images/mountain.jpg")
),
div(`class` := "col-md-10")
)
),
div(
`class` := "row border-bottom",
div(
`class` := "col-md-12",
div(
`class` := "col-md-12",
h1(`class` := "text-center", "Dashboard")
)
)
)
)
したがって、テストしようとしているときに utest を使用すると、上記のエラーが発生します。助けてください。
PS - 私は Scala と ScalaJs の初心者です。