From a1f5d42283071d42f6725518f1cd4f51955c8e0d Mon Sep 17 00:00:00 2001 From: Barak Amar Date: Thu, 17 Apr 2025 17:13:28 +0300 Subject: [PATCH] Update the test code to align with latest changes --- pkg/cmd/pr/shared/finder_test.go | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/pkg/cmd/pr/shared/finder_test.go b/pkg/cmd/pr/shared/finder_test.go index 09c2bf7a7..66fb900eb 100644 --- a/pkg/cmd/pr/shared/finder_test.go +++ b/pkg/cmd/pr/shared/finder_test.go @@ -83,19 +83,6 @@ func TestFind(t *testing.T) { wantPR: 13, wantRepo: "https://github.com/ORIGINOWNER/REPO", }, - { - name: "PR number 0 is invalid", - args: args{ - selector: "0", - fields: []string{"id", "number"}, - baseRepoFn: stubBaseRepoFn(ghrepo.New("ORIGINOWNER", "REPO"), nil), - branchFn: func() (string, error) { - return "blueberries", nil - }, - branchConfig: stubBranchConfig(git.BranchConfig{}, nil), - }, - wantErr: true, - }, { name: "number argument with base branch", args: args{ @@ -178,6 +165,25 @@ func TestFind(t *testing.T) { wantPR: 13, wantRepo: "https://github.com/ORIGINOWNER/REPO", }, + { + name: "pr number zero", + args: args{ + selector: "0", + fields: []string{"number"}, + baseRepoFn: stubBaseRepoFn(ghrepo.New("ORIGINOWNER", "REPO"), nil), + branchFn: func() (string, error) { + return "blueberries", nil + }, + gitConfigClient: stubGitConfigClient{ + readBranchConfigFn: stubBranchConfig(git.BranchConfig{}, nil), + pushDefaultFn: stubPushDefault(git.PushDefaultSimple, nil), + remotePushDefaultFn: stubRemotePushDefault("", nil), + }, + }, + httpStub: nil, + wantPR: 0, + wantRepo: "https://github.com/ORIGINOWNER/REPO", + }, { name: "number with hash argument", args: args{