Skip to content

Commit 5ddba9e

Browse files
committed
fix: update notification worker tests for medium priority error handling
- Changed test case name from "medium_priority_error_skipped" to "medium_priority_error_creates_notification" to reflect the new behavior. - Updated expected notification creation to true and set the priority to PriorityMedium, ensuring the test accurately verifies the notification logic. - Refactored loop in TestNotificationWorker_CircuitBreaker to use range for better readability, while maintaining functionality. These changes enhance the clarity and accuracy of the notification worker tests, aligning them with the recent priority handling updates.
1 parent fc04c8c commit 5ddba9e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

internal/notification/worker_test.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,15 @@ func TestNotificationWorker_ProcessEvent(t *testing.T) {
7474
expectPriority: PriorityHigh,
7575
},
7676
{
77-
name: "medium_priority_error_skipped",
77+
name: "medium_priority_error_creates_notification",
7878
event: &mockErrorEvent{
7979
component: "network",
8080
category: string(errors.CategoryNetwork),
8181
message: "Temporary network issue",
8282
timestamp: time.Now(),
8383
},
84-
expectNotif: false,
84+
expectNotif: true,
85+
expectPriority: PriorityMedium,
8586
},
8687
{
8788
name: "low_priority_error_skipped",
@@ -199,7 +200,8 @@ func TestNotificationWorker_CircuitBreaker(t *testing.T) {
199200
// Process events until circuit opens
200201
// Need to exceed rate limit (2) and trigger failures
201202
successCount := 0
202-
for i := 0; i < 10; i++ {
203+
for i := range 10 {
204+
_ = i // unused
203205
err := worker.ProcessEvent(event)
204206
if err == nil {
205207
successCount++

0 commit comments

Comments
 (0)