From 3d9c4f6da18ab74383f1d86dcbf85f82ef5c1f57 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Tue, 2 Dec 2025 14:26:17 +0000 Subject: [PATCH] test: Add UpdateStatus not found test for notifications package --- internal/notifications/queue_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/internal/notifications/queue_test.go b/internal/notifications/queue_test.go index d54aba7..be04138 100644 --- a/internal/notifications/queue_test.go +++ b/internal/notifications/queue_test.go @@ -652,6 +652,20 @@ func TestGetQueueStats(t *testing.T) { t.Errorf("failed count = %d, want 1", stats["failed"]) } }) + + t.Run("UpdateStatus returns error for non-existent notification", func(t *testing.T) { + tempDir := t.TempDir() + nq, err := NewNotificationQueue(tempDir) + if err != nil { + t.Fatalf("Failed to create notification queue: %v", err) + } + defer nq.Stop() + + err = nq.UpdateStatus("non-existent-id", QueueStatusSent, "") + if err == nil { + t.Error("expected error when updating non-existent notification, got nil") + } + }) } func TestPerformCleanup(t *testing.T) {