From: David ‘Bombe’ Roden Date: Fri, 17 May 2019 10:05:36 +0000 (+0200) Subject: ✨ Annotate BookmarksPage with MenuName X-Git-Tag: v79^2~39 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=dbfecdac857030a686d76907008a3a49cde20d2b;p=Sone.git ✨ Annotate BookmarksPage with MenuName --- diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/BookmarksPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/BookmarksPage.kt index f6cdd0b..c73ce3d 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/BookmarksPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/BookmarksPage.kt @@ -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") { diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/BookmarksPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/BookmarksPageTest.kt index 2186f61..b3882e5 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/BookmarksPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/BookmarksPageTest.kt @@ -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(), notNullValue()) } + @Test + fun `page is annotated with correct menuname`() { + assertThat(page.menuName, equalTo("Bookmarks")) + } + + }