X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Ftest%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fnotification%2FNewRemotePostHandlerTest.kt;h=0f24affb352c342a152339621b740cd3d4c46128;hb=faf66247a34f64946990a985d2ea3003465969cb;hp=fc04b8b1b40cd4392f4a1fb6ca0b54ad1e65d94e;hpb=8d5853b15e60fcea8408b10e4efa64467c70bdec;p=Sone.git diff --git a/src/test/kotlin/net/pterodactylus/sone/web/notification/NewRemotePostHandlerTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/notification/NewRemotePostHandlerTest.kt index fc04b8b..0f24aff 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/notification/NewRemotePostHandlerTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/notification/NewRemotePostHandlerTest.kt @@ -1,5 +1,5 @@ /** - * Sone - NewRemotePostHandlerTest.kt - Copyright © 2019 David ‘Bombe’ Roden + * Sone - NewRemotePostHandlerTest.kt - Copyright © 2019–2020 David ‘Bombe’ Roden * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -68,6 +68,20 @@ class NewRemotePostHandlerTest { assertThat(remotePostHandlerTest.notifications, not(hasItem(notification))) } + @Test + fun `handler removes post from notification if post is removed`() { + notification.add(remotePost) + remotePostHandlerTest.sendEvent(PostRemovedEvent(remotePost)) + assertThat(notification.elements, not(hasItem(remotePost))) + } + + @Test + fun `handler removes post from notification if post is marked as known`() { + notification.add(remotePost) + remotePostHandlerTest.sendEvent(MarkPostKnownEvent(remotePost)) + assertThat(notification.elements, not(hasItem(remotePost))) + } + } private val remoteSone: Sone = IdOnlySone("remote-sone")