feat: add notification center and reliable client presence
This commit is contained in:
@@ -3,6 +3,8 @@ package httpapi
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"rmm-openwrt/server/internal/model"
|
||||
)
|
||||
|
||||
func TestNotificationRetryDelay(t *testing.T) {
|
||||
@@ -16,3 +18,15 @@ func TestNotificationRetryDelay(t *testing.T) {
|
||||
t.Fatalf("retry cap: got %s want 30m", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNotificationQuietHoursAcrossMidnight(t *testing.T) {
|
||||
settings := model.NotificationSettings{
|
||||
Timezone: "UTC", QuietHoursEnabled: true, QuietHoursStart: "22:00", QuietHoursEnd: "08:00",
|
||||
}
|
||||
if !notificationQuietNow(settings, time.Date(2026, 7, 30, 23, 0, 0, 0, time.UTC)) {
|
||||
t.Fatal("23:00 must be quiet")
|
||||
}
|
||||
if notificationQuietNow(settings, time.Date(2026, 7, 30, 12, 0, 0, 0, time.UTC)) {
|
||||
t.Fatal("12:00 must not be quiet")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user