🚧 Add Loaders to all template-using pages
[Sone.git] / src / test / kotlin / net / pterodactylus / sone / web / pages / WebPageTest.kt
index 5d4f7a9..f5bab99 100644 (file)
@@ -13,6 +13,7 @@ import net.pterodactylus.sone.data.PostReply
 import net.pterodactylus.sone.data.Sone
 import net.pterodactylus.sone.data.TemporaryImage
 import net.pterodactylus.sone.freenet.wot.OwnIdentity
+import net.pterodactylus.sone.main.*
 import net.pterodactylus.sone.test.deepMock
 import net.pterodactylus.sone.test.get
 import net.pterodactylus.sone.test.mock
@@ -42,9 +43,10 @@ import kotlin.text.Charsets.UTF_8
 /**
  * Base class for web page tests.
  */
-open class WebPageTest(pageSupplier: (Template, WebInterface) -> SoneTemplatePage = { _, _ -> mock() }) {
+open class WebPageTest(pageSupplier: (Template, WebInterface, Loaders) -> SoneTemplatePage = { _, _, _ -> mock() }) {
 
        val currentSone = mock<Sone>()
+       val loaders = mock<Loaders>()
        val template = mock<Template>()
        val webInterface = deepMock<WebInterface>()
        val core = webInterface.core
@@ -53,7 +55,7 @@ open class WebPageTest(pageSupplier: (Template, WebInterface) -> SoneTemplatePag
        val l10n = webInterface.l10n!!
        val sessionManager = mock<SessionManager>()
 
-       val page by lazy { pageSupplier(template, webInterface) }
+       val page by lazy { pageSupplier(template, webInterface, loaders) }
 
        val httpRequest = mock<HTTPRequest>()
        val freenetRequest = mock<FreenetRequest>()