aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api/v1
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2024-11-07 11:57:07 +0800
committerGitHub <noreply@github.com>2024-11-07 03:57:07 +0000
commit145e26698791221b007c7dd460fb506cb0237235 (patch)
treeceeff90fbc2a1e97d906daa9a8023b399c04dcf8 /routers/api/v1
parent276500c314db1c0ef360088753861ffc010a99da (diff)
downloadgitea-145e26698791221b007c7dd460fb506cb0237235.tar.gz
gitea-145e26698791221b007c7dd460fb506cb0237235.zip
Support quote selected comments to reply (#32431)
Many existing tests were quite hacky, these could be improved later. <details> ![image](https://github.com/user-attachments/assets/93aebb4f-9de5-4cb8-910b-50c64cbcd25a) </details>
Diffstat (limited to 'routers/api/v1')
-rw-r--r--routers/api/v1/misc/markup_test.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/routers/api/v1/misc/markup_test.go b/routers/api/v1/misc/markup_test.go
index e2ab7141b7..abffdf3516 100644
--- a/routers/api/v1/misc/markup_test.go
+++ b/routers/api/v1/misc/markup_test.go
@@ -38,7 +38,8 @@ func testRenderMarkup(t *testing.T, mode string, wiki bool, filePath, text, expe
ctx, resp := contexttest.MockAPIContext(t, "POST /api/v1/markup")
web.SetForm(ctx, &options)
Markup(ctx)
- assert.Equal(t, expectedBody, resp.Body.String())
+ actual := strings.ReplaceAll(resp.Body.String(), ` data-markdown-generated-content=""`, "")
+ assert.Equal(t, expectedBody, actual)
assert.Equal(t, expectedCode, resp.Code)
resp.Body.Reset()
}
@@ -58,7 +59,8 @@ func testRenderMarkdown(t *testing.T, mode string, wiki bool, text, responseBody
ctx, resp := contexttest.MockAPIContext(t, "POST /api/v1/markdown")
web.SetForm(ctx, &options)
Markdown(ctx)
- assert.Equal(t, responseBody, resp.Body.String())
+ actual := strings.ReplaceAll(resp.Body.String(), ` data-markdown-generated-content=""`, "")
+ assert.Equal(t, responseBody, actual)
assert.Equal(t, responseCode, resp.Code)
resp.Body.Reset()
}