MCPcopy Index your code
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// profile name. Default Bootstrap ships one profile called "local". No
560// brackets: the label is just the name (bold).
561func TestBackendLabelShowsActiveProfile(t *testing.T) {
562 cfg, _, _ := config.Bootstrap(t.TempDir())
563 if cfg.Active != "local" {
564 t.Fatalf("default Active expected local, got %q", cfg.Active)
565 }
566 label := stripANSI(backendLabel(cfg, true))
567 if label != "local" {
568 t.Fatalf("expected plain 'local' label, got %q", label)
569 }
570 // second profile → label follows Active when switched
571 cfg.Models["remote"] = &config.Profile{LLM: "m", URL: "http://r"}
572 cfg.Active = "remote"
573 if got := stripANSI(backendLabel(cfg, true)); got != "remote" {
574 t.Fatalf("expected 'remote' after switch, got %q", got)
575 }
576}
577
578// TestPrintHelpListsAllCommands: tui.PrintHelp formats every command in the
579// central slice. Guards against a command being added to runSlash dispatch

Callers

nothing calls this directly

Calls 3

BootstrapFunction · 0.92
stripANSIFunction · 0.85
backendLabelFunction · 0.85

Tested by

no test coverage detected