Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

test: update GetAllFindings test to match filtering behavior

rcourtman92ccb35e738e
diff --git a/internal/ai/patrol_test.go b/internal/ai/patrol_test.go
index d2aabbb6ac..633801b7a4 100644
--- a/internal/ai/patrol_test.go
+++ b/internal/ai/patrol_test.go
@@ -863,6 +863,7 @@ func TestPatrolService_GetAllFindings(t *testing.T) {
ps := NewPatrolService(nil, nil)
// Add findings with different severities
+ // Note: GetAllFindings now filters out info/watch findings (only returns warning+)
ps.findings.Add(&Finding{
ID: "f1",
Severity: FindingSeverityInfo,
@@ -884,8 +885,9 @@ func TestPatrolService_GetAllFindings(t *testing.T) {
findings := ps.GetAllFindings()
- if len(findings) != 3 {
- t.Fatalf("Expected 3 findings, got %d", len(findings))
+ // GetAllFindings filters out info/watch - only returns critical and warning
+ if len(findings) != 2 {
+ t.Fatalf("Expected 2 findings (critical+warning only), got %d", len(findings))
}
// Should be sorted by severity (critical first)
@@ -895,9 +897,6 @@ func TestPatrolService_GetAllFindings(t *testing.T) {
if findings[1].Severity != FindingSeverityWarning {
t.Errorf("Expected second finding to be warning, got %s", findings[1].Severity)
}
- if findings[2].Severity != FindingSeverityInfo {
- t.Errorf("Expected third finding to be info, got %s", findings[2].Severity)
- }
}
func TestPatrolService_GetFindingsHistory(t *testing.T) {