Skip to content

Commit

Permalink
Update unit tests for rendered list feature
Browse files Browse the repository at this point in the history
commit-id:1f55083a
  • Loading branch information
ejoffe authored and Eitan Joffe committed Dec 6, 2021
1 parent 9a0e69a commit b7d34c8
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions spr/spr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ func TestSPRBasicFlowFourCommits(t *testing.T) {
gitmock.ExpectLogAndRespond([]*git.Commit{&c1})
gitmock.ExpectPushCommits([]*git.Commit{&c1})
githubmock.ExpectCreatePullRequest(c1, nil)
githubmock.ExpectUpdatePullRequest(c1, nil)
githubmock.ExpectGetInfo()
s.UpdatePullRequests(ctx)
fmt.Printf("OUT: %s\n", output.String())
Expand All @@ -89,6 +90,8 @@ func TestSPRBasicFlowFourCommits(t *testing.T) {
gitmock.ExpectLogAndRespond([]*git.Commit{&c2, &c1})
gitmock.ExpectPushCommits([]*git.Commit{&c2})
githubmock.ExpectCreatePullRequest(c2, &c1)
githubmock.ExpectUpdatePullRequest(c1, nil)
githubmock.ExpectUpdatePullRequest(c2, &c1)
githubmock.ExpectGetInfo()
s.UpdatePullRequests(ctx)
lines := strings.Split(output.String(), "\n")
Expand All @@ -104,6 +107,10 @@ func TestSPRBasicFlowFourCommits(t *testing.T) {
gitmock.ExpectPushCommits([]*git.Commit{&c3, &c4})
githubmock.ExpectCreatePullRequest(c3, &c2)
githubmock.ExpectCreatePullRequest(c4, &c3)
githubmock.ExpectUpdatePullRequest(c1, nil)
githubmock.ExpectUpdatePullRequest(c2, &c1)
githubmock.ExpectUpdatePullRequest(c3, &c2)
githubmock.ExpectUpdatePullRequest(c4, &c3)
githubmock.ExpectGetInfo()
s.UpdatePullRequests(ctx)
lines = strings.Split(output.String(), "\n")
Expand Down Expand Up @@ -163,6 +170,8 @@ func TestSPRAmendCommit(t *testing.T) {
gitmock.ExpectPushCommits([]*git.Commit{&c1, &c2})
githubmock.ExpectCreatePullRequest(c1, nil)
githubmock.ExpectCreatePullRequest(c2, &c1)
githubmock.ExpectUpdatePullRequest(c1, nil)
githubmock.ExpectUpdatePullRequest(c2, &c1)
githubmock.ExpectGetInfo()
s.UpdatePullRequests(ctx)
fmt.Printf("OUT: %s\n", output.String())
Expand All @@ -178,6 +187,7 @@ func TestSPRAmendCommit(t *testing.T) {
gitmock.ExpectFetch()
gitmock.ExpectLogAndRespond([]*git.Commit{&c2, &c1})
gitmock.ExpectPushCommits([]*git.Commit{&c2})
githubmock.ExpectUpdatePullRequest(c1, nil)
githubmock.ExpectUpdatePullRequest(c2, &c1)
githubmock.ExpectGetInfo()
s.UpdatePullRequests(ctx)
Expand Down Expand Up @@ -262,6 +272,10 @@ func TestSPRReorderCommit(t *testing.T) {
githubmock.ExpectCreatePullRequest(c2, &c1)
githubmock.ExpectCreatePullRequest(c3, &c2)
githubmock.ExpectCreatePullRequest(c4, &c3)
githubmock.ExpectUpdatePullRequest(c1, nil)
githubmock.ExpectUpdatePullRequest(c2, &c1)
githubmock.ExpectUpdatePullRequest(c3, &c2)
githubmock.ExpectUpdatePullRequest(c4, &c3)
githubmock.ExpectGetInfo()
s.UpdatePullRequests(ctx)
fmt.Printf("OUT: %s\n", output.String())
Expand Down Expand Up @@ -345,6 +359,10 @@ func TestSPRDeleteCommit(t *testing.T) {
githubmock.ExpectCreatePullRequest(c2, &c1)
githubmock.ExpectCreatePullRequest(c3, &c2)
githubmock.ExpectCreatePullRequest(c4, &c3)
githubmock.ExpectUpdatePullRequest(c1, nil)
githubmock.ExpectUpdatePullRequest(c2, &c1)
githubmock.ExpectUpdatePullRequest(c3, &c2)
githubmock.ExpectUpdatePullRequest(c4, &c3)
githubmock.ExpectGetInfo()

s.UpdatePullRequests(ctx)
Expand Down

0 comments on commit b7d34c8

Please sign in to comment.