(t *testing.T)
| 327 | } |
| 328 | |
| 329 | func TestBuildMCPEmptyNote(t *testing.T) { |
| 330 | if got := buildMCPEmptyNote(nil); got != "" { |
| 331 | t.Errorf("no servers should yield empty note, got %q", got) |
| 332 | } |
| 333 | if got := buildMCPEmptyNote([]mcp.ServerStatus{}); got != "" { |
| 334 | t.Errorf("empty slice should yield empty note, got %q", got) |
| 335 | } |
| 336 | starting := buildMCPEmptyNote([]mcp.ServerStatus{ |
| 337 | {Name: "a", Starting: true}, |
| 338 | {Name: "b", Connected: false}, |
| 339 | }) |
| 340 | // Both locales must surface that the server is not ready yet |
| 341 | // (en: "not ready yet" / "launching"; pt-BR: "ainda não está pronto"). |
| 342 | if !strings.Contains(starting, "not ready") && !strings.Contains(starting, "launching") && |
| 343 | !strings.Contains(starting, "ainda não está pronto") && !strings.Contains(starting, "iniciando") { |
| 344 | t.Errorf("starting note missing keyword:\n%s", starting) |
| 345 | } |
| 346 | failed := buildMCPEmptyNote([]mcp.ServerStatus{ |
| 347 | {Name: "a", Connected: false}, |
| 348 | }) |
| 349 | // en: "no server is connected"; pt-BR: "nenhum servidor está conectado". |
| 350 | if !strings.Contains(failed, "no server is connected") && !strings.Contains(failed, "nenhum servidor está conectado") { |
| 351 | t.Errorf("unavailable note missing keyword:\n%s", failed) |
| 352 | } |
| 353 | } |
| 354 | |
| 355 | func TestMCPConfigWatcherFiresOnFileWrite(t *testing.T) { |
| 356 | dir := t.TempDir() |
nothing calls this directly
no test coverage detected