mirror of
https://github.com/go-gitea/gitea
synced 2025-07-15 23:17:19 +00:00
Refactor webhook (#31587)
A more complete fix for #31588 1. Make "generic" code more readable 2. Clarify HTML or Markdown for the payload content
This commit is contained in:
@@ -424,10 +424,10 @@ func TestGetIssuesPayloadInfo(t *testing.T) {
|
||||
|
||||
for i, c := range cases {
|
||||
p.Action = c.action
|
||||
text, issueTitle, attachmentText, color := getIssuesPayloadInfo(p, noneLinkFormatter, true)
|
||||
text, issueTitle, extraMarkdown, color := getIssuesPayloadInfo(p, noneLinkFormatter, true)
|
||||
assert.Equal(t, c.text, text, "case %d", i)
|
||||
assert.Equal(t, c.issueTitle, issueTitle, "case %d", i)
|
||||
assert.Equal(t, c.attachmentText, attachmentText, "case %d", i)
|
||||
assert.Equal(t, c.attachmentText, extraMarkdown, "case %d", i)
|
||||
assert.Equal(t, c.color, color, "case %d", i)
|
||||
}
|
||||
}
|
||||
@@ -523,10 +523,10 @@ func TestGetPullRequestPayloadInfo(t *testing.T) {
|
||||
|
||||
for i, c := range cases {
|
||||
p.Action = c.action
|
||||
text, issueTitle, attachmentText, color := getPullRequestPayloadInfo(p, noneLinkFormatter, true)
|
||||
text, issueTitle, extraMarkdown, color := getPullRequestPayloadInfo(p, noneLinkFormatter, true)
|
||||
assert.Equal(t, c.text, text, "case %d", i)
|
||||
assert.Equal(t, c.issueTitle, issueTitle, "case %d", i)
|
||||
assert.Equal(t, c.attachmentText, attachmentText, "case %d", i)
|
||||
assert.Equal(t, c.attachmentText, extraMarkdown, "case %d", i)
|
||||
assert.Equal(t, c.color, color, "case %d", i)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user