mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 11:01:25 +01:00
fix(pr,time,release): closed PRs for checkout and edit, dismiss state check first, worktree-aware checkout errors, exact piped durations (follow gh)
Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
11 files changed
+131
-23
No files matched your search
@@ -288,6 +288,21 @@ func TestReviewDismissChecksTheReviewStateFirst(t *testing.T) {
|
||||
require.Zero(t, mutations)
|
||||
}
|
||||
|
||||
func TestReviewDismissOpensNoEditorForAnUndismissableReview(t *testing.T) {
|
||||
server := newAuthenticatedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
require.Equal(t, http.MethodGet, r.Method)
|
||||
_, _ = w.Write([]byte(`{"id":2,"state":"COMMENT","user":{"login":"bob"}}`))
|
||||
}))
|
||||
defer server.Close()
|
||||
deps, _, _ := testDeps(t)
|
||||
editor, _ := newDraftEditor(t, "Reason")
|
||||
deps.Editor = editor
|
||||
deps.Getenv = serverEnv(server.URL, map[string]string{"EDITOR": "editor"})
|
||||
err := Execute(context.Background(), deps, []string{"pr", "review", "dismiss", "1", "2", "-R", "alice/project", "--editor", "--no-input", "--yes"})
|
||||
require.ErrorContains(t, err, "only approvals and change requests can be dismissed")
|
||||
require.Empty(t, editor.command, "the editor must not open")
|
||||
}
|
||||
|
||||
func TestReviewDeleteAndDismissRequireYesWithoutInput(t *testing.T) {
|
||||
mutations := 0
|
||||
server := newAuthenticatedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
Reference in new issue
Block a user