X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Ftest%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fnotification%2FNotificationHandlerModuleTest.kt;h=a06123071649f7341cc0090af1cbbbfe7b78c747;hp=8a4bcc99033d50deaec993f6e17b4911dd468f18;hb=b31f0234988a509ca831785c87433ab264374d0a;hpb=e6aa326d36fc1d653ed5473fd02af8cba8992b9a diff --git a/src/test/kotlin/net/pterodactylus/sone/web/notification/NotificationHandlerModuleTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/notification/NotificationHandlerModuleTest.kt index 8a4bcc9..a061230 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/notification/NotificationHandlerModuleTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/notification/NotificationHandlerModuleTest.kt @@ -343,4 +343,31 @@ class NotificationHandlerModuleTest { injector.verifySingletonInstance() } + @Test + fun `config-not-read notification is created as singleton`() { + injector.verifySingletonInstance(named("configNotRead")) + } + + @Test + fun `config-not-read notification has correct ID `() { + assertThat(injector.getInstance(named("configNotRead")).id, equalTo("config-not-read-notification")) + } + + @Test + fun `config-not-read notification is dismissable`() { + assertThat(injector.getInstance(named("configNotRead")).isDismissable, equalTo(true)) + } + + @Test + fun `config-not-read notification loads correct template`() { + loaders.templates += "/templates/notify/configNotReadNotification.html" to "1".asTemplate() + val notification = injector.getInstance(named("configNotRead")) + assertThat(notification.render(), equalTo("1")) + } + + @Test + fun `config-not-read handler is created as singleton`() { + injector.verifySingletonInstance() + } + }