✨ Use @TemplatePath annotations on most pages
[Sone.git] / src / test / kotlin / net / pterodactylus / sone / web / pages / AboutPageTest.kt
index 156b361..a2fd178 100644 (file)
@@ -4,6 +4,7 @@ import net.pterodactylus.sone.main.*
 import net.pterodactylus.sone.test.getInstance
 import net.pterodactylus.sone.test.isProvidedByMock
 import net.pterodactylus.sone.web.baseInjector
+import net.pterodactylus.sone.web.page.*
 import org.hamcrest.MatcherAssert.assertThat
 import org.hamcrest.Matchers.equalTo
 import org.hamcrest.Matchers.notNullValue
@@ -12,7 +13,7 @@ import org.junit.Test
 /**
  * Unit test for [AboutPage].
  */
-class AboutPageTest : WebPageTest({ template, webInterface -> AboutPage(template, webInterface, PluginVersion(version), PluginYear(year), PluginHomepage(homepage)) }) {
+class AboutPageTest : WebPageTest({ template, webInterface, loaders, templateRenderer -> AboutPage(template, webInterface, loaders, templateRenderer, PluginVersion(version), PluginYear(year), PluginHomepage(homepage)) }) {
 
        companion object {
                private const val version = "0.1.2"
@@ -58,4 +59,14 @@ class AboutPageTest : WebPageTest({ template, webInterface -> AboutPage(template
                assertThat(injector.getInstance<AboutPage>(), notNullValue())
        }
 
+       @Test
+       fun `page is annotated with correct menuname`() {
+           assertThat(page.menuName, equalTo("About"))
+       }
+
+       @Test
+       fun `page is annotated with correct template path`() {
+           assertThat(page.templatePath, equalTo("/templates/about.html"))
+       }
+
 }