Files
kato 149fcde379 feat(agent): add screen blackout feature
- Physical displays blanked via overlay
- Remote video and input keep working
- Exclude overlay from screen capture
- Add blackout API and UI toggle
- Wire flag through capture protocol
2026-09-02 13:32:21 +03:00

49 lines
1.2 KiB
Go

package openapi
import "testing"
func TestSpec(t *testing.T) {
spec := Spec()
if spec["openapi"] != "3.0.3" {
t.Fatalf("openapi version = %v", spec["openapi"])
}
paths, ok := spec["paths"].(map[string]any)
if !ok || len(paths) < 12 {
t.Fatalf("expected at least 12 paths, got %d", len(paths))
}
if _, ok := paths["/api/v1/blackout"]; !ok {
t.Fatal("missing /api/v1/blackout")
}
if _, ok := paths["/api/v1/watchdog"]; !ok {
t.Fatal("missing /api/v1/watchdog")
}
if _, ok := spec["security"]; !ok {
t.Fatal("missing security")
}
components, ok := spec["components"].(map[string]any)
if !ok {
t.Fatal("missing components")
}
if _, ok := components["securitySchemes"]; !ok {
t.Fatal("missing securitySchemes")
}
schemas, ok := components["schemas"].(map[string]any)
if !ok || len(schemas) < 10 {
t.Fatalf("expected schemas, got %d", len(schemas))
}
status, ok := schemas["Status"].(map[string]any)
if !ok {
t.Fatal("missing Status schema")
}
props, ok := status["properties"].(map[string]any)
if !ok {
t.Fatal("missing Status properties")
}
if _, ok := props["klogging"]; !ok {
t.Fatal("Status missing klogging")
}
if _, ok := props["keylog_enabled"]; ok {
t.Fatal("Status still has keylog_enabled")
}
}