From 6b857193ff6d159e249c6d9036b242975584ea8f Mon Sep 17 00:00:00 2001 From: oliverpool Date: Mon, 25 Mar 2024 16:17:02 +0100 Subject: [PATCH] [TESTS] pull review deleted from gitea#29888 Instead of db.TruncateBeans(db.DefaultContext, &issues_model.Review{}), reviews are deleted using issue.DeleteReview --- models/fixtures/comment.yml | 8 ++++++++ models/fixtures/review.yml | 9 +++++++++ routers/web/repo/pull_review_test.go | 27 +++++++++++++++++++++++++++ tests/integration/pull_review_test.go | 19 +++++++++++++++++-- 4 files changed, 61 insertions(+), 2 deletions(-) diff --git a/models/fixtures/comment.yml b/models/fixtures/comment.yml index 17586caa2..74fc71618 100644 --- a/models/fixtures/comment.yml +++ b/models/fixtures/comment.yml @@ -75,3 +75,11 @@ content: "comment in private pository" created_unix: 946684811 updated_unix: 946684811 + +- + id: 9 + type: 22 # review + poster_id: 2 + issue_id: 2 # in repo_id 1 + review_id: 20 + created_unix: 946684810 diff --git a/models/fixtures/review.yml b/models/fixtures/review.yml index 7a8808006..ac97e24c2 100644 --- a/models/fixtures/review.yml +++ b/models/fixtures/review.yml @@ -170,3 +170,12 @@ content: "review request for user15" updated_unix: 946684835 created_unix: 946684835 + +- + id: 20 + type: 22 + reviewer_id: 1 + issue_id: 2 + content: "Review Comment" + updated_unix: 946684810 + created_unix: 946684810 diff --git a/routers/web/repo/pull_review_test.go b/routers/web/repo/pull_review_test.go index d87656f79..70f6a0e05 100644 --- a/routers/web/repo/pull_review_test.go +++ b/routers/web/repo/pull_review_test.go @@ -4,6 +4,7 @@ package repo import ( + "net/http" "net/http/httptest" "testing" @@ -75,4 +76,30 @@ func TestRenderConversation(t *testing.T) { renderConversation(ctx, preparedComment, "timeline") assert.Contains(t, resp.Body.String(), `