summaryrefslogtreecommitdiff
path: root/internal/hexaiaction/run_more_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-02 14:54:08 +0200
committerPaul Buetow <paul@buetow.org>2026-03-02 14:54:08 +0200
commitf80462176d1ad0daf20b05d6410074369148c245 (patch)
tree5cbe412797c923a881333bd89d59d238be646ad7 /internal/hexaiaction/run_more_test.go
parent5f8e008fc2e5a9abb8bc2c8cfe66ec49cce3a19d (diff)
hexaiaction: replace global action state with Runner struct (task 406)
Diffstat (limited to 'internal/hexaiaction/run_more_test.go')
-rw-r--r--internal/hexaiaction/run_more_test.go8
1 files changed, 2 insertions, 6 deletions
diff --git a/internal/hexaiaction/run_more_test.go b/internal/hexaiaction/run_more_test.go
index 57bd933..0e391ed 100644
--- a/internal/hexaiaction/run_more_test.go
+++ b/internal/hexaiaction/run_more_test.go
@@ -85,20 +85,16 @@ func TestHandleSimplifyActionPassesSelection(t *testing.T) {
}
}
-func TestHandleCustomActionUsesSelectedCustom(t *testing.T) {
+func TestHandleCustomActionUsesProvidedCustom(t *testing.T) {
t.Setenv("HEXAI_TMUX_STATUS", "0")
sel := appconfig.CustomAction{ID: "custom", Title: "Do", Instruction: "do it"}
- selectedCustom = &sel
parts := InputParts{Selection: "text"}
client := &stubChatDoer{}
cfg := appconfig.Load(nil)
- if _, err := handleCustomAction(context.Background(), parts, cfg, client); err != nil {
+ if _, err := handleCustomAction(context.Background(), parts, cfg, client, &sel); err != nil {
t.Fatalf("handleCustomAction: %v", err)
}
if client.calls != 1 {
t.Fatalf("expected custom action to invoke chat, got %d calls", client.calls)
}
- if selectedCustom != nil {
- t.Fatal("expected selectedCustom to be cleared")
- }
}