diff options
| author | Paul Buetow <paul@buetow.org> | 2026-06-18 07:45:37 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-06-18 07:45:37 +0300 |
| commit | 4ffb22e7f69f1c9c79b095d4e60bad3d97aac55b (patch) | |
| tree | 2dc708cbb95975d34084eb5afd376871caa13e27 /internal/hexaiaction/tui_config_test.go | |
| parent | ece7dcfd232b780f5650326c8ac2379ca70387d4 (diff) | |
ik0 replace test seams with dependency injection
Diffstat (limited to 'internal/hexaiaction/tui_config_test.go')
| -rw-r--r-- | internal/hexaiaction/tui_config_test.go | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/internal/hexaiaction/tui_config_test.go b/internal/hexaiaction/tui_config_test.go index e8e178f..e1723ab 100644 --- a/internal/hexaiaction/tui_config_test.go +++ b/internal/hexaiaction/tui_config_test.go @@ -154,19 +154,16 @@ func TestHandleKey_ChosenCustomIsSet(t *testing.T) { } func TestRunTUIFromConfig_ViaTmuxActionSeam(t *testing.T) { - old := teaNewProgram - t.Cleanup(func() { teaNewProgram = old }) - - teaNewProgram = func(m model) teaProgram { + r := tuiRunner{newProgram: func(m model) teaProgram { return fakeProg{m: m, onRun: func(mm *model) { mm.chosen = ActionSkip }} - } + }} entries := []appconfig.TmuxActionMenuEntry{ {Kind: "skip", Hotkey: "s"}, } - kind, custom, err := RunTUIFromConfig(entries, nil) + kind, custom, err := r.RunTUIFromConfig(entries, nil) if err != nil { t.Fatalf("RunTUIFromConfig: %v", err) } |
