@@ -127,6 +127,34 @@ func TestCheckE2E(t *testing.T) {
127
127
resource.Version {PR : developPullRequestID , Commit : developCommitID , CommittedDate : developDateTime },
128
128
},
129
129
},
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
+ },
130
158
}
131
159
132
160
for _ , tc := range tests {
0 commit comments