Update the test code to align with latest changes
This commit is contained in:
parent
265139f268
commit
a1f5d42283
1 changed files with 19 additions and 13 deletions
|
|
@ -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{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue