✨ Annotate AboutPage with MenuName
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 17 May 2019 10:05:10 +0000 (12:05 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 17 May 2019 10:05:10 +0000 (12:05 +0200)
src/main/kotlin/net/pterodactylus/sone/web/pages/AboutPage.kt
src/test/kotlin/net/pterodactylus/sone/web/pages/AboutPageTest.kt

index b55511a..422364a 100644 (file)
@@ -2,7 +2,7 @@ package net.pterodactylus.sone.web.pages
 
 import net.pterodactylus.sone.main.*
 import net.pterodactylus.sone.web.WebInterface
-import net.pterodactylus.sone.web.page.FreenetRequest
+import net.pterodactylus.sone.web.page.*
 import net.pterodactylus.util.template.Template
 import net.pterodactylus.util.template.TemplateContext
 import javax.inject.Inject
@@ -10,6 +10,7 @@ import javax.inject.Inject
 /**
  * A [SoneTemplatePage] that stores information about Sone in the [TemplateContext].
  */
+@MenuName("About")
 class AboutPage @Inject constructor(template: Template, webInterface: WebInterface,
                private val pluginVersion: PluginVersion,
                private val pluginYear: PluginYear,
index 156b361..1be5fa6 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
@@ -58,4 +59,9 @@ 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"))
+       }
+
 }