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

Function TestBackendLabelShowsActiveProfile

internal/tui/tui_test.go:561–576  ·  view source on GitHub ↗

TestBackendLabelShowsActiveProfile: the label echoes the currently-active profile name. Default Bootstrap ships one profile called "local". No brackets: the label is just the name (bold).

(t *testing.T)

Source from the content-addressed store, hash-verified

559// TestBackendLabelShowsActiveProfile: the label echoes the currently-active
560// profile name. Default Bootstrap ships one profile called "local". No
561// brackets: the label is just the name (bold).
562func TestBackendLabelShowsActiveProfile(t *testing.T) {
563 cfg, _, _ := config.Bootstrap(t.TempDir())
564 if cfg.Active != "local" {
565 t.Fatalf("default Active expected local, got %q", cfg.Active)
566 }
567 label := stripANSI(backendLabel(cfg, true))
568 if label != "local" {
569 t.Fatalf("expected plain 'local' label, got %q", label)
570 }
571 // second profile → label follows Active when switched
572 cfg.Models["remote"] = &config.Profile{LLM: "m", URL: "http://r"}
573 cfg.Active = "remote"
574 if got := stripANSI(backendLabel(cfg, true)); got != "remote" {
575 t.Fatalf("expected 'remote' after switch, got %q", got)
576 }
577}
578
579// TestPrintHelpListsAllCommands: tui.PrintHelp formats every command in the

Callers

nothing calls this directly

Calls 3

BootstrapFunction · 0.92
stripANSIFunction · 0.85
backendLabelFunction · 0.85

Tested by

no test coverage detected