fix: address verified review findings (labels-milestones-time-1)

Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
bircni committed 2026-10-18 17:40:59 +02:00
1 parent be3b8a1ced
commit e28bb6e039
21 files changed
+262 -47

No files matched your search

+22
View File
@@ -443,3 +443,25 @@ func TestActionValueCompletionOutsideARepository(t *testing.T) {
require.ElementsMatch(t, tc.want, values, name)
}
}
func TestMilestoneCompletionOffersTheMilestonesTheCommandAccepts(t *testing.T) {
var states []string
server := newAuthenticatedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if r.URL.Path == "/api/v1/repos/alice/project/milestones" {
states = append(states, r.URL.Query().Get("state"))
}
_, _ = w.Write([]byte(`[]`))
}))
defer server.Close()
deps, _, _ := serverDeps(t, server.URL)
a := &application{deps: deps}
a.options.repo = "alice/project"
root := a.milestoneCommand()
for _, path := range [][]string{{"reopen"}, {"close"}, {"view"}, {"issue", "list"}} {
cmd, _, err := root.Find(path)
require.NoError(t, err)
cmd.SetContext(context.Background())
cmd.ValidArgsFunction(cmd, nil, "")
}
require.Equal(t, []string{"closed", "open", "all", "all"}, states)
}