mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-14 22:59:29 +01:00
Fix the logic of finding the latest pull review commit ID (#32139) (followup)
Adjust the tests for review deletion to ignore a newly inserted fixture. It is a review request and cannot be deleted.
This commit is contained in:
parent
1bee6fa839
commit
6488d15860
1 changed files with 5 additions and 2 deletions
|
@ -60,6 +60,9 @@ func TestAPIPullReviewCreateDeleteComment(t *testing.T) {
|
|||
var reviews []*api.PullReview
|
||||
DecodeJSON(t, resp, &reviews)
|
||||
for _, review := range reviews {
|
||||
if review.State == api.ReviewStateRequestReview {
|
||||
continue
|
||||
}
|
||||
req := NewRequestf(t, http.MethodDelete, "/api/v1/repos/%s/pulls/%d/reviews/%d", repo.FullName(), pullIssue.Index, review.ID).
|
||||
AddTokenAuth(token)
|
||||
MakeRequest(t, req, http.StatusNoContent)
|
||||
|
@ -93,7 +96,7 @@ func TestAPIPullReviewCreateDeleteComment(t *testing.T) {
|
|||
DecodeJSON(t, resp, &getReview)
|
||||
require.EqualValues(t, getReview, review)
|
||||
}
|
||||
requireReviewCount(1)
|
||||
requireReviewCount(2)
|
||||
|
||||
newCommentBody := "first new line"
|
||||
var reviewComment api.PullReviewComment
|
||||
|
@ -140,7 +143,7 @@ func TestAPIPullReviewCreateDeleteComment(t *testing.T) {
|
|||
AddTokenAuth(token)
|
||||
MakeRequest(t, req, http.StatusNoContent)
|
||||
}
|
||||
requireReviewCount(0)
|
||||
requireReviewCount(1)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue