Skip to content

Commit

Permalink
Merge pull request #139 from telia-oss/pr-review-e2e-tests
Browse files Browse the repository at this point in the history
Add e2e tests for reviews filter
  • Loading branch information
Kristian authored Aug 9, 2019
2 parents 0414f3e + 4308aa1 commit 9b813da
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,34 @@ func TestCheckE2E(t *testing.T) {
resource.Version{PR: developPullRequestID, Commit: developCommitID, CommittedDate: developDateTime},
},
},

{
description: "check works with required review approvals",
source: resource.Source{
Repository: "itsdalmo/test-repository",
AccessToken: os.Getenv("GITHUB_ACCESS_TOKEN"),
V3Endpoint: "https://api.github.com/",
V4Endpoint: "https://api.github.com/graphql",
RequiredReviewApprovals: 1,
},
version: resource.Version{},
expected: resource.CheckResponse{
resource.Version{PR: targetPullRequestID, Commit: targetCommitID, CommittedDate: targetDateTime},
},
},

{
description: "check works when we require multiple review approvals",
source: resource.Source{
Repository: "itsdalmo/test-repository",
AccessToken: os.Getenv("GITHUB_ACCESS_TOKEN"),
V3Endpoint: "https://api.github.com/",
V4Endpoint: "https://api.github.com/graphql",
RequiredReviewApprovals: 2,
},
version: resource.Version{},
expected: resource.CheckResponse(nil),
},
}

for _, tc := range tests {
Expand Down

0 comments on commit 9b813da

Please sign in to comment.