MCPcopy Create free account
hub / github.com/codehamr/codehamr / TestErrorMessageUnreachable

Function TestErrorMessageUnreachable

internal/tui/tui_test.go:1437–1454  ·  view source on GitHub ↗

TestErrorMessageUnreachable verifies the unreachable hint names the active profile's URL and steers the user toward /models to switch profiles.

(t *testing.T)

Source from the content-addressed store, hash-verified

1435 m.phase = phaseRunning
1436 if !strings.Contains(m.renderStatusBar(), "running") {
1437 t.Fatalf("running status bar must show running indicator: %q", m.renderStatusBar())
1438 }
1439}
1440
1441// TestBackendLabelReflectsConnectedState asserts the backend label renders
1442// differently when connected vs not: the user's at-a-glance "are we
1443// talking to a server?" signal. Disconnected appends a `!` marker so the
1444// distinction survives on colour-stripped terminals.
1445func TestBackendLabelReflectsConnectedState(t *testing.T) {
1446 cfg, _, _ := config.Bootstrap(t.TempDir())
1447 ok := backendLabel(cfg, true)
1448 bad := backendLabel(cfg, false)
1449 if ok == bad {
1450 t.Fatalf("connected and disconnected labels must render differently, got %q for both", ok)
1451 }
1452 if stripANSI(ok) != "local" {
1453 t.Fatalf("connected label should be plain profile name: %q", stripANSI(ok))
1454 }
1455 if got := stripANSI(bad); !strings.Contains(got, "local") || !strings.Contains(got, "!") {
1456 t.Fatalf("disconnected label must include profile name and '!' marker: %q", got)
1457 }

Callers

nothing calls this directly

Calls 3

newTestModelFunction · 0.85
ActiveProfileMethod · 0.80
errorMessageMethod · 0.80

Tested by

no test coverage detected