Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: prepare release #724

Merged
merged 5 commits into from
Feb 24, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
test: add coverage for skipping review
  • Loading branch information
zolamk committed Feb 24, 2023
commit 3869f29f5bf503918d45e7f46dca6850910cd3e3
40 changes: 40 additions & 0 deletions plugins/aladino/actions/review_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,46 @@ func TestReview(t *testing.T) {
inputReviewBody: "test",
wantErr: fmt.Errorf("review: unsupported review state NOT_SUPPORTED"),
},
"when latest review is the same as the one we want to create": {
clientOptions: []mock.MockBackendOption{},
mockedLatestReviewFromReviewerGQLQueryBody: `{
"data": {
"repository": {
"pullRequest": {
"reviews": {
"nodes": [{
"author": {
"login": "test"
},
"body": "test",
"state": "APPROVED",
"submittedAt": "2022-11-26T19:01:12Z"
}]
}
}
}
}
}`,
mockedLastPullRequestPushDateGQLQueryBody: `{
"data": {
"repository": {
"pullRequest": {
"timelineItems": {
"nodes": [{
"__typename": "PullRequestCommit",
"commit": {
"pushedDate": "2022-11-11T13:36:05Z",
"committedDate": "2022-11-11T13:36:05Z"
}
}]
}
}
}
}
}`,
inputReviewEvent: "APPROVE",
inputReviewBody: "test",
},
}

for name, test := range tests {
Expand Down