From f2ac84cc43ac9e844d45f4bfd177858115fa1805 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 17 May 2019 12:06:45 +0200 Subject: [PATCH] =?utf8?q?=E2=9C=A8=20Annotate=20ImageBrowserPage=20with?= =?utf8?q?=20MenuName?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../kotlin/net/pterodactylus/sone/web/pages/ImageBrowserPage.kt | 1 + .../kotlin/net/pterodactylus/sone/web/pages/ImageBrowserPageTest.kt | 6 ++++++ 2 files changed, 7 insertions(+) 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")) + } + } -- 2.7.4