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

index f6cdd0b..c73ce3d 100644 (file)
@@ -11,6 +11,7 @@ import javax.inject.Inject
 /**
  * Page that lets the user browse all his bookmarked posts.
  */
+@MenuName("Bookmarks")
 class BookmarksPage @Inject constructor(template: Template, webInterface: WebInterface) :
                SoneTemplatePage("bookmarks.html", webInterface, template, "Page.Bookmarks.Title") {
 
index 2186f61..b3882e5 100644 (file)
@@ -6,6 +6,7 @@ import net.pterodactylus.sone.test.mock
 import net.pterodactylus.sone.test.whenever
 import net.pterodactylus.sone.utils.Pagination
 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
@@ -64,4 +65,10 @@ class BookmarksPageTest: WebPageTest(::BookmarksPage) {
                assertThat(baseInjector.getInstance<BookmarksPage>(), notNullValue())
        }
 
+       @Test
+       fun `page is annotated with correct menuname`() {
+           assertThat(page.menuName, equalTo("Bookmarks"))
+       }
+
+
 }