feat: add AssertNotSent helper to notification testing

This commit is contained in:
kolaente 2026-03-26 11:19:09 +01:00 committed by kolaente
parent 04f94a5801
commit 6dc46c1898
1 changed files with 13 additions and 0 deletions

View File

@ -44,3 +44,16 @@ func AssertSent(t *testing.T, n Notification) {
assert.True(t, found, "Failed to assert "+n.Name()+" has been sent.")
}
// AssertNotSent asserts a notification has not been sent
func AssertNotSent(t *testing.T, n Notification) {
var found bool
for _, testNotification := range sentTestNotifications {
if n.Name() == testNotification.Name() {
found = true
break
}
}
assert.False(t, found, "Expected "+n.Name()+" to not have been sent, but it was.")
}