Refactor webhook payload convertion (#12310)
* Refactor webhook payload convertion * Fix lint Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
parent
e1535c74cc
commit
b51bd7f1d6
12 changed files with 397 additions and 454 deletions
|
@ -16,9 +16,9 @@ func TestGetTelegramIssuesPayload(t *testing.T) {
|
|||
p := issueTestPayload()
|
||||
p.Action = api.HookIssueClosed
|
||||
|
||||
pl, err := getTelegramIssuesPayload(p)
|
||||
pl, err := new(TelegramPayload).Issue(p)
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, pl)
|
||||
|
||||
assert.Equal(t, "[<a href=\"http://localhost:3000/test/repo\">test/repo</a>] Issue closed: <a href=\"http://localhost:3000/test/repo/issues/2\">#2 crash</a> by <a href=\"https://try.gitea.io/user1\">user1</a>\n\n", pl.Message)
|
||||
assert.Equal(t, "[<a href=\"http://localhost:3000/test/repo\">test/repo</a>] Issue closed: <a href=\"http://localhost:3000/test/repo/issues/2\">#2 crash</a> by <a href=\"https://try.gitea.io/user1\">user1</a>\n\n", pl.(*TelegramPayload).Message)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue