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

index 8b4218d..a7bd2fa 100644 (file)
@@ -13,6 +13,7 @@ import javax.inject.Inject
  * Page that displays all new posts and replies. The posts are filtered using
  * [PostVisibilityFilter.isPostVisible(Sone, Post)] and sorted by time.
  */
+@MenuName("New")
 class NewPage @Inject constructor(  template: Template, webInterface: WebInterface):
                SoneTemplatePage("new.html", webInterface, template, "Page.New.Title") {
 
index 0565c0f..187b666 100644 (file)
@@ -89,4 +89,9 @@ class NewPageTest: WebPageTest(::NewPage) {
            assertThat(baseInjector.getInstance<NewPage>(), notNullValue())
        }
 
+       @Test
+       fun `page is annotated with the correct menuname`() {
+           assertThat(page.menuName, equalTo("New"))
+       }
+
 }