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:
bircni committed 2026-10-18 20:38:01 +02:00
1 parent 6224190bd9
commit 339527b26c
11 files changed
+131 -23

No files matched your search

+15
View File
@@ -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) {