test pr number 0

This commit is contained in:
Barak Amar 2025-04-07 22:38:28 +03:00
parent 8d9c9bcf50
commit 747f015f48

View file

@ -89,6 +89,19 @@ 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{