MCPcopy Index your code
hub / github.com/codehamr/codehamr / TestArgPopoverOpensForModels

Function TestArgPopoverOpensForModels

internal/tui/tui_test.go:461–487  ·  view source on GitHub ↗

TestArgPopoverOpensForModels: "/models " shows the profile names (no synthetic "next", Tab cycles instead) with the active profile preselected.

(t *testing.T)

Source from the content-addressed store, hash-verified

459// TestArgPopoverOpensForModels: "/models " shows the profile names (no synthetic
460// "next", Tab cycles instead) with the active profile preselected.
461func TestArgPopoverOpensForModels(t *testing.T) {
462 m := newTestModel(t, func(http.ResponseWriter, *http.Request) {})
463 // Bootstrap seeds local + hamrpass; drop the latter so this asserts popover
464 // content, not config defaults.
465 delete(m.cfg.Models, "hamrpass")
466 m.cfg.Models["remote"] = &config.Profile{
467 LLM: "cloud-model", URL: "http://r", Key: "sk-r", ContextSize: 200000,
468 }
469 // Persist so the popover's cmd→arg reload reads back the test setup.
470 if err := m.cfg.Save(); err != nil {
471 t.Fatal(err)
472 }
473 mm := typeInto(m, "/models ")
474 if !mm.suggestArgLevel || mm.activeCmd != "/models" {
475 t.Fatalf("expected arg-level for /models: level=%v cmd=%q",
476 mm.suggestArgLevel, mm.activeCmd)
477 }
478 names := suggestNames(mm)
479 // sorted: [local, remote], no "next"
480 if len(names) != 2 || names[0] != "local" || names[1] != "remote" {
481 t.Fatalf("expected [local remote], got %v", names)
482 }
483 if mm.suggest[mm.suggestIdx].value != "local" {
484 t.Fatalf("default selection should be active profile 'local', got %q",
485 mm.suggest[mm.suggestIdx].value)
486 }
487}
488
489// TestHistoryUpDownReplayLastSubmission: ↑ on first-line replaces textarea
490// with the most recent submitted line; ↓ steps back toward the draft.

Callers

nothing calls this directly

Calls 4

newTestModelFunction · 0.85
typeIntoFunction · 0.85
suggestNamesFunction · 0.85
SaveMethod · 0.80

Tested by

no test coverage detected