From 890a2f792dd2f743345363bb696ac633c3a451de Mon Sep 17 00:00:00 2001 From: rcourtman Date: Tue, 2 Dec 2025 00:29:12 +0000 Subject: [PATCH] test: Add edge case for NormalizeAppriseConfig low timeout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Test TimeoutSeconds value between 1-4 clamps to minimum of 5. Coverage: 97.4% → 100% --- internal/notifications/notifications_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/internal/notifications/notifications_test.go b/internal/notifications/notifications_test.go index e827d8f..aab8e85 100644 --- a/internal/notifications/notifications_test.go +++ b/internal/notifications/notifications_test.go @@ -104,6 +104,17 @@ func TestNormalizeAppriseConfig(t *testing.T) { if disabledHTTP.Enabled { t.Fatalf("expected HTTP config without server URL to disable notifications") } + + // Test timeout below minimum (1-4 seconds should clamp to 5) + lowTimeout := NormalizeAppriseConfig(AppriseConfig{ + Enabled: true, + Mode: AppriseModeHTTP, + ServerURL: "https://apprise.example.com", + TimeoutSeconds: 3, + }) + if lowTimeout.TimeoutSeconds != 5 { + t.Fatalf("expected timeout to clamp to 5 for values 1-4, got %d", lowTimeout.TimeoutSeconds) + } } func TestSetCooldownClampsNegativeValues(t *testing.T) {