forked from forgejo/forgejo
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:
parent
17d246cdcc
commit
58f5fa6536
11 changed files with 155 additions and 6 deletions
|
@ -144,6 +144,18 @@ func TestFeishuPayload(t *testing.T) {
|
|||
assert.Equal(t, "[test/repo] Repository created", pl.(*FeishuPayload).Content.Text)
|
||||
})
|
||||
|
||||
t.Run("Package", func(t *testing.T) {
|
||||
p := packageTestPayload()
|
||||
|
||||
d := new(FeishuPayload)
|
||||
pl, err := d.Package(p)
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, pl)
|
||||
require.IsType(t, &FeishuPayload{}, pl)
|
||||
|
||||
assert.Equal(t, "Package created: GiteaContainer:latest by user1", pl.(*FeishuPayload).Content.Text)
|
||||
})
|
||||
|
||||
t.Run("Wiki", func(t *testing.T) {
|
||||
p := wikiTestPayload()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue