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

index d7714cd..ba16e21 100644 (file)
@@ -14,6 +14,7 @@ import javax.inject.Inject
 /**
  * The image browser page is the entry page for the image management.
  */
+@MenuName("ImageBrowser")
 class ImageBrowserPage @Inject constructor(template: Template, webInterface: WebInterface):
                LoggedInPage("imageBrowser.html", template, "Page.ImageBrowser.Title", webInterface) {
 
index c2bedfe..faf70b8 100644 (file)
@@ -7,6 +7,7 @@ import net.pterodactylus.sone.test.getInstance
 import net.pterodactylus.sone.test.mock
 import net.pterodactylus.sone.test.whenever
 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
@@ -142,4 +143,9 @@ class ImageBrowserPageTest: WebPageTest(::ImageBrowserPage) {
            assertThat(baseInjector.getInstance<ImageBrowserPage>(), notNullValue())
        }
 
+       @Test
+       fun `page is annotated with correct menuname`() {
+           assertThat(page.menuName, equalTo("ImageBrowser"))
+       }
+
 }