package api import ( "testing" "gitea.dooplex.hu/admin/felhom-hub/internal/notify" ) // The four upload-watch types are accepted from a box (an unlisted type is a 400 and is dropped) AND operator-only — // both registers, same commit. RED-PROOF: drop one from allowedEventTypes → fails. func TestUpwatchEventTypesAreAllowedAndOperatorOnly(t *testing.T) { for _, et := range []string{"app_unexplained_upload", "app_unexplained_upload_cleared", "app_unexplained_cpu", "app_unexplained_cpu_cleared"} { if !allowedEventTypes[et] { t.Errorf("%s is not in allowedEventTypes — POST /event would 400 and the alarm would be lost", et) } if !notify.IsOperatorOnly(et) { t.Errorf("%s is not operator-only", et) } } }