From 6dc46c1898dce728f0b16ab8156026dc99d20b4e Mon Sep 17 00:00:00 2001 From: kolaente Date: Thu, 26 Mar 2026 11:19:09 +0100 Subject: [PATCH] feat: add AssertNotSent helper to notification testing --- pkg/notifications/testing.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkg/notifications/testing.go b/pkg/notifications/testing.go index bdc8be334..2fd301f8f 100644 --- a/pkg/notifications/testing.go +++ b/pkg/notifications/testing.go @@ -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.") +}