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=6bb02f4ba140b1b649522dff2c7310d9b3a9c8a4;hp=d4000b5cf7bf563f03f3bbdc0f246d574e95a8d4;hb=05ebea72f846cf147a51938b15e6f0cd93773f4e;hpb=9fab21ef1d4d158a3ba2531edbba715c32ec663f 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 d4000b5..6bb02f4 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/notification/NotificationHandlerModuleTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/notification/NotificationHandlerModuleTest.kt @@ -265,4 +265,36 @@ class NotificationHandlerModuleTest { injector.verifySingletonInstance() } + @Test + fun `new-version notification is created as singleton`() { + injector.verifySingletonInstance(named("newVersion")) + } + + @Test + fun `new-version notification has correct ID`() { + assertThat(injector.getInstance(named("newVersion")).id, equalTo("new-version-notification")) + } + + @Test + fun `new-version notification is dismissable`() { + assertThat(injector.getInstance(named("newVersion")).isDismissable, equalTo(true)) + } + + @Test + fun `new-version notification loads correct template`() { + loaders.templates += "/templates/notify/newVersionNotification.html" to "1".asTemplate() + val notification = injector.getInstance(named("newVersion")) + assertThat(notification.render(), equalTo("1")) + } + + @Test + fun `new-version handler can be created`() { + assertThat(injector.getInstance(), notNullValue()) + } + + @Test + fun `new-version handler is created as singleton`() { + injector.verifySingletonInstance() + } + }