mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 19:11:25 +01:00
fix(pr): review decision ignores comment reviews, paged review list, pending review comments hidden, team request names (follow gh)
Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
19 files changed
+258
-50
No files matched your search
@@ -56,6 +56,22 @@ func complete(t *testing.T, deps Dependencies, out *bytes.Buffer, args ...string
|
||||
return lines[:len(lines)-1], cobra.ShellCompDirective(directive)
|
||||
}
|
||||
|
||||
func TestPullCompletionStopsAfterTheLastPositionalArgument(t *testing.T) {
|
||||
requests := 0
|
||||
server := newAuthenticatedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
requests++
|
||||
_, _ = w.Write([]byte(`[{"id":9,"number":9,"title":"More"}]`))
|
||||
}))
|
||||
defer server.Close()
|
||||
deps, out, _ := serverDeps(t, server.URL)
|
||||
for _, args := range []string{"pr view 5 ", "pr review list 5 ", "pr review view 5 9 ", "pr review submit 5 9 ", "pr review reply 5 9 "} {
|
||||
items, directive := complete(t, deps, out, append(strings.Fields(args), "-R", "owner/repo", "")...)
|
||||
require.Empty(t, items, args)
|
||||
require.Equal(t, cobra.ShellCompDirectiveNoFileComp, directive, args)
|
||||
}
|
||||
require.Zero(t, requests, "no argument is left to complete")
|
||||
}
|
||||
|
||||
func TestEnumFlagsShareValidationAndCompletion(t *testing.T) {
|
||||
deps, out, _ := testDeps(t)
|
||||
var state string
|
||||
|
||||
Reference in new issue
Block a user