From: David ‘Bombe’ Roden Date: Fri, 17 May 2019 10:06:45 +0000 (+0200) Subject: ✨ Annotate ImageBrowserPage with MenuName X-Git-Tag: v79^2~37 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=f2ac84cc43ac9e844d45f4bfd177858115fa1805;p=Sone.git ✨ Annotate ImageBrowserPage with MenuName --- diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/ImageBrowserPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/ImageBrowserPage.kt index d7714cd..ba16e21 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/ImageBrowserPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/ImageBrowserPage.kt @@ -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) { diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/ImageBrowserPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/ImageBrowserPageTest.kt index c2bedfe..faf70b8 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/ImageBrowserPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/ImageBrowserPageTest.kt @@ -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(), notNullValue()) } + @Test + fun `page is annotated with correct menuname`() { + assertThat(page.menuName, equalTo("ImageBrowser")) + } + }