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

index 20251c0..96e8b27 100644 (file)
@@ -13,6 +13,7 @@ import javax.inject.Inject
 /**
  * The login page lets the user log in.
  */
+@MenuName("Login")
 class LoginPage @Inject constructor(template: Template, webInterface: WebInterface):
                SoneTemplatePage("login.html", webInterface, template, "Page.Login.Title") {
 
index 9d29a55..794e68b 100644 (file)
@@ -8,6 +8,7 @@ import net.pterodactylus.sone.test.mock
 import net.pterodactylus.sone.test.thenReturnMock
 import net.pterodactylus.sone.test.whenever
 import net.pterodactylus.sone.web.baseInjector
+import net.pterodactylus.sone.web.page.*
 import net.pterodactylus.util.web.Method.POST
 import org.hamcrest.MatcherAssert.assertThat
 import org.hamcrest.Matchers.contains
@@ -146,4 +147,9 @@ class LoginPageTest: WebPageTest(::LoginPage) {
            assertThat(baseInjector.getInstance<LoginPage>(), notNullValue())
        }
 
+       @Test
+       fun `page is annotated with correct menuname`() {
+           assertThat(page.menuName, equalTo("Login"))
+       }
+
 }