Files
ARTEX/server/manager_browser_mcp_test.go
T
Coff0xc 3546ea0fff fix(mcp): rewrite npx -y and playwright-mcp rows missing --browser
The stock seed was npx @playwright/mcp, but the UI mock and common
invocations use npx -y, which the first pass left untouched. Also add
--browser chromium to a leftover playwright-mcp --headless row, resolve
the MCP's playwright-core CLI via require.resolve, and cover proxy-arg
stripping so capture sync does not depend on args[0].
2026-11-18 22:42:38 +01:00

25 lines
649 B
Go

package server
import (
"slices"
"testing"
)
func TestStripProxyArgsLeavesBrowserMCPFlags(t *testing.T) {
in := []string{"--headless", "--browser", "chromium", "--proxy-server", "http://127.0.0.1:8788"}
got := stripProxyArgs(in)
want := []string{"--headless", "--browser", "chromium"}
if !slices.Equal(got, want) {
t.Fatalf("got %q, want %q", got, want)
}
if in[3] != "--proxy-server" {
t.Fatal("input mutated")
}
equals := []string{"--headless", "--proxy-server=http://127.0.0.1:8788", "--browser", "chromium"}
got = stripProxyArgs(equals)
if !slices.Equal(got, want) {
t.Fatalf("equals form: got %q, want %q", got, want)
}
}