mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 11:01:25 +01:00
fix: address verified review findings (labels-milestones-time-1)
Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
21 files changed
+262
-47
No files matched your search
@@ -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)
|
||||
}
|
||||
Reference in new issue
Block a user