mirror of
https://github.com/go-gitea/gitea
synced 2025-07-07 02:57:20 +00:00
Fix Matrix and MSTeams nil dereference (#28089)
Fixes #28088 Fixes #28094 Added missing tests. --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
@ -144,6 +144,18 @@ func TestSlackPayload(t *testing.T) {
|
||||
assert.Equal(t, "[<http://localhost:3000/test/repo|test/repo>] Repository created by <https://try.gitea.io/user1|user1>", pl.(*SlackPayload).Text)
|
||||
})
|
||||
|
||||
t.Run("Package", func(t *testing.T) {
|
||||
p := packageTestPayload()
|
||||
|
||||
d := new(SlackPayload)
|
||||
pl, err := d.Package(p)
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, pl)
|
||||
require.IsType(t, &SlackPayload{}, pl)
|
||||
|
||||
assert.Equal(t, "Package created: <http://localhost:3000/user1/-/packages/container/GiteaContainer/latest|GiteaContainer:latest> by <https://try.gitea.io/user1|user1>", pl.(*SlackPayload).Text)
|
||||
})
|
||||
|
||||
t.Run("Wiki", func(t *testing.T) {
|
||||
p := wikiTestPayload()
|
||||
|
||||
|
Reference in New Issue
Block a user