Update the test code to align with latest changes

This commit is contained in:
Barak Amar 2025-04-17 17:13:28 +03:00
parent 265139f268
commit a1f5d42283

View file

@ -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{