✨ Annotate KnownSonesPage with MenuName
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 17 May 2019 09:45:54 +0000 (11:45 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 17 May 2019 09:45:54 +0000 (11:45 +0200)
src/main/kotlin/net/pterodactylus/sone/web/pages/KnownSonesPage.kt
src/test/kotlin/net/pterodactylus/sone/web/pages/KnownSonesPageTest.kt

index 59b79e7..dd96832 100644 (file)
@@ -12,6 +12,7 @@ import javax.inject.Inject
 /**
  * This page shows all known Sones.
  */
+@MenuName("KnownSones")
 class KnownSonesPage @Inject constructor(template: Template, webInterface: WebInterface):
                SoneTemplatePage("knownSones.html", webInterface, template, "Page.KnownSones.Title") {
 
index ef837be..bc46b9d 100644 (file)
@@ -13,6 +13,7 @@ import net.pterodactylus.sone.test.mock
 import net.pterodactylus.sone.test.whenever
 import net.pterodactylus.sone.utils.Pagination
 import net.pterodactylus.sone.web.baseInjector
+import net.pterodactylus.sone.web.page.*
 import org.hamcrest.MatcherAssert.assertThat
 import org.hamcrest.Matchers.contains
 import org.hamcrest.Matchers.equalTo
@@ -250,4 +251,9 @@ class KnownSonesPageTest: WebPageTest(::KnownSonesPage) {
            assertThat(baseInjector.getInstance<KnownSonesPage>(), notNullValue())
        }
 
+       @Test
+       fun `page is annotated with the correct menuname`() {
+           assertThat(page.menuName, equalTo("KnownSones"))
+       }
+
 }