test: verify Operations Console process output

This commit is contained in:
proxyctl coordinator
2026-07-17 20:47:41 +08:00
parent 8ac0695152
commit dd4ebddb45
+18 -1
View File
@@ -242,9 +242,26 @@ func TestCommandsRunAsRealProcessesInsideIsolatedUserState(t *testing.T) {
}
defaultOutput, err := invoke("q")
if err != nil || !strings.Contains(string(defaultOutput), "proxyctl — Target panel") {
if err != nil {
t.Fatalf("default process err=%v output=%q", err, defaultOutput)
}
defaultView := string(defaultOutput)
for _, expected := range []string{
"proxyctl Operations Console",
"Active Profile: No Active Profile",
"Targets: ● Enabled 0 ○ Disabled 1 ◇ External 0 ! Drifted 1",
"▶ Targets [focused]",
"> ○ Disabled Shell",
"! Drifted Docker daemon",
"Target details",
"State: ○ Disabled",
"Evidence: no recognized Shell proxy configuration detected",
"Tab: focus details",
} {
if !strings.Contains(defaultView, expected) {
t.Errorf("default Operations Console missing %q; output=%q", expected, defaultOutput)
}
}
versionOutput, err := invoke("", "version", "--short")
if err != nil || strings.TrimSpace(string(versionOutput)) == "" || strings.Contains(string(versionOutput), " ") {
t.Fatalf("version process err=%v output=%q", err, versionOutput)