Skip to content

Commit dc254dd

Browse files
waynemsmithclaude
andcommitted
Add test: search does not inject default board
Verifies that setting cfg.Board does not cause board_ids[] to appear in the search path when --board is not explicitly passed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d5b64bf commit dc254dd

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

internal/commands/search_test.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,29 @@ func TestSearch(t *testing.T) {
122122
}
123123
})
124124

125+
t.Run("does not inject default board into search", func(t *testing.T) {
126+
mock := NewMockClient()
127+
mock.GetWithPaginationResponse = &client.APIResponse{
128+
StatusCode: 200,
129+
Data: []any{},
130+
}
131+
132+
SetTestModeWithSDK(mock)
133+
SetTestConfig("token", "account", "https://api.example.com")
134+
cfg.Board = "default-board-id"
135+
defer resetTest()
136+
137+
searchBoard = ""
138+
err := searchCmd.RunE(searchCmd, []string{"bug"})
139+
searchBoard = ""
140+
141+
assertExitCode(t, err, 0)
142+
path := mock.GetWithPaginationCalls[0].Path
143+
if path != "/cards.json?terms[]=bug" {
144+
t.Errorf("expected no board_ids in path, got '%s'", path)
145+
}
146+
})
147+
125148
t.Run("requires authentication", func(t *testing.T) {
126149
mock := NewMockClient()
127150
SetTestModeWithSDK(mock)

0 commit comments

Comments
 (0)