test: empty existing comment

This commit is contained in:
oliverpool 2024-04-25 11:20:04 +02:00
parent 7624b78544
commit 0d37f3a79b

View file

@ -307,6 +307,16 @@ func TestIssueCommentUpdate(t *testing.T) {
comment = unittest.AssertExistsAndLoadBean(t, &issues_model.Comment{ID: commentID}) comment = unittest.AssertExistsAndLoadBean(t, &issues_model.Comment{ID: commentID})
assert.Equal(t, modifiedContent, comment.Content) assert.Equal(t, modifiedContent, comment.Content)
// make the comment empty
req = NewRequestWithValues(t, "POST", fmt.Sprintf("/%s/%s/comments/%d", "user2", "repo1", commentID), map[string]string{
"_csrf": GetCSRF(t, session, issueURL),
"content": "",
})
session.MakeRequest(t, req, http.StatusOK)
comment = unittest.AssertExistsAndLoadBean(t, &issues_model.Comment{ID: commentID})
assert.Equal(t, "", comment.Content)
} }
func TestIssueReaction(t *testing.T) { func TestIssueReaction(t *testing.T) {