mirror of
https://github.com/go-gitea/gitea.git
synced 2026-11-02 13:44:16 +09:00
A simple workaround to fix https://github.com/go-gitea/gitea/issues/40003 Backport of https://github.com/go-gitea/gitea/pull/40014
This commit is contained in:
1 parent
1b8a7c4d85
commit
79189a959f
3 files changed
+46
No files matched your search
@@ -29,6 +29,7 @@ import (
|
||||
|
||||
"github.com/PuerkitoBio/goquery"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func getIssuesSelection(t testing.TB, htmlDoc *HTMLDoc) *goquery.Selection {
|
||||
@@ -780,3 +781,15 @@ func TestIssueReferenceURL(t *testing.T) {
|
||||
ref, _ = htmlDoc.Find(`.timeline-item.comment:not(.issue-content-comment) .reference-issue`).Attr("data-reference")
|
||||
assert.Equal(t, setting.AppURL+"user2/repo1/issues/1#issuecomment-2", ref)
|
||||
}
|
||||
|
||||
func TestIssueCommentContent(t *testing.T) {
|
||||
defer tests.PrepareTestEnv(t)()
|
||||
|
||||
issue := &issues_model.Issue{Title: "title\x00content", Content: "body\x00content"}
|
||||
require.NoError(t, db.Insert(t.Context(), issue))
|
||||
unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: issue.ID, Title: "title content", Content: "body content"})
|
||||
|
||||
comment := &issues_model.Comment{Content: "body\x00content"}
|
||||
require.NoError(t, db.Insert(t.Context(), comment))
|
||||
unittest.AssertExistsAndLoadBean(t, &issues_model.Comment{ID: comment.ID, Content: "body content"})
|
||||
}
|
||||
Reference in new issue
Block a user