Skip to content

Commit 9b813da

Browse files
author
Kristian
authored
Merge pull request #139 from telia-oss/pr-review-e2e-tests
Add e2e tests for reviews filter
2 parents 0414f3e + 4308aa1 commit 9b813da

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

e2e/e2e_test.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,34 @@ func TestCheckE2E(t *testing.T) {
127127
resource.Version{PR: developPullRequestID, Commit: developCommitID, CommittedDate: developDateTime},
128128
},
129129
},
130+
131+
{
132+
description: "check works with required review approvals",
133+
source: resource.Source{
134+
Repository: "itsdalmo/test-repository",
135+
AccessToken: os.Getenv("GITHUB_ACCESS_TOKEN"),
136+
V3Endpoint: "https://api.github.com/",
137+
V4Endpoint: "https://api.github.com/graphql",
138+
RequiredReviewApprovals: 1,
139+
},
140+
version: resource.Version{},
141+
expected: resource.CheckResponse{
142+
resource.Version{PR: targetPullRequestID, Commit: targetCommitID, CommittedDate: targetDateTime},
143+
},
144+
},
145+
146+
{
147+
description: "check works when we require multiple review approvals",
148+
source: resource.Source{
149+
Repository: "itsdalmo/test-repository",
150+
AccessToken: os.Getenv("GITHUB_ACCESS_TOKEN"),
151+
V3Endpoint: "https://api.github.com/",
152+
V4Endpoint: "https://api.github.com/graphql",
153+
RequiredReviewApprovals: 2,
154+
},
155+
version: resource.Version{},
156+
expected: resource.CheckResponse(nil),
157+
},
130158
}
131159

132160
for _, tc := range tests {

0 commit comments

Comments
 (0)