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=8a4bcc99033d50deaec993f6e17b4911dd468f18;hp=1410ed3d67163fe8945d683f45671ef862d37bd1;hb=8bd33b61d226641aad09285e97c156d4d6e25aed;hpb=1b4f8c0f65eb4db3831585743b326d2588b36cef 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 1410ed3..8a4bcc9 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/notification/NotificationHandlerModuleTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/notification/NotificationHandlerModuleTest.kt @@ -316,4 +316,31 @@ class NotificationHandlerModuleTest { injector.verifySingletonInstance() } + @Test + fun `first-start notification is created as singleton`() { + injector.verifySingletonInstance(named("firstStart")) + } + + @Test + fun `first-start notification has correct ID`() { + assertThat(injector.getInstance(named("firstStart")).id, equalTo("first-start-notification")) + } + + @Test + fun `first-start notification is dismissable`() { + assertThat(injector.getInstance(named("firstStart")).isDismissable, equalTo(true)) + } + + @Test + fun `first-start notification loads correct template`() { + loaders.templates += "/templates/notify/firstStartNotification.html" to "1".asTemplate() + val notification = injector.getInstance(named("firstStart")) + assertThat(notification.render(), equalTo("1")) + } + + @Test + fun `first-start handler is created as singleton`() { + injector.verifySingletonInstance() + } + }