+ @Test
+ fun `page returns information about loaded elements`() {
+ addLinkedElement("KSK@test.png", loading = false, failed = false)
+ addLinkedElement("KSK@test.html", loading = true, failed = false)
+ addLinkedElement("KSK@test.jpeg", loading = false, failed = true)
+ addRequestParameter("elements", jsonArray("KSK@test.png", "KSK@test.html", "KSK@test.jpeg").toString())
+ assertThat(json.get("linkedElements")!!.elements().asSequence().map { it.toMap() }.toList(), containsInAnyOrder(
+ mapOf<String, String?>("link" to "KSK@test.png", "loading" to "false", "failed" to "false"),
+ mapOf("link" to "KSK@test.html", "loading" to "true", "failed" to "false"),
+ mapOf("link" to "KSK@test.jpeg", "loading" to "false", "failed" to "true")
+ ))
+ }
+
+ @Test
+ fun `page can be created by dependency injection`() {
+ assertThat(baseInjector.createChildInjector(
+ ElementLoader::class.isProvidedByMock(),
+ TimeTextConverter::class.isProvidedByMock(),
+ L10nFilter::class.isProvidedByMock()
+ ).getInstance<GetStatusAjaxPage>(), notNullValue())
+ }
+