summaryrefslogtreecommitdiffstats
path: root/services/webhook/dingtalk_test.go
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2022-10-16 18:22:34 +0200
committerGitHub <noreply@github.com>2022-10-17 00:22:34 +0800
commitcad9adeff41595ea32281dbc2918e653c3e3a839 (patch)
treea62bf796f12655c85323ded8922c6ea1d5e256ed /services/webhook/dingtalk_test.go
parent6f48a36227b7427afd2020aa416afe49d4c81015 (diff)
downloadgitea-cad9adeff41595ea32281dbc2918e653c3e3a839.tar.gz
gitea-cad9adeff41595ea32281dbc2918e653c3e3a839.zip
Display total commit count in hook message (#21400)
Fixes #21379 The commits are capped by `setting.UI.FeedMaxCommitNum` so `len(commits)` is not the correct number. So this PR adds a new `TotalCommits` field. Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'services/webhook/dingtalk_test.go')
-rw-r--r--services/webhook/dingtalk_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/services/webhook/dingtalk_test.go b/services/webhook/dingtalk_test.go
index efc9601c12..fc15380f4d 100644
--- a/services/webhook/dingtalk_test.go
+++ b/services/webhook/dingtalk_test.go
@@ -82,7 +82,7 @@ func TestDingTalkPayload(t *testing.T) {
assert.Equal(t, "[2020558](http://localhost:3000/test/repo/commit/2020558fe2e34debb818a514715839cabd25e778) commit message - user1\r\n[2020558](http://localhost:3000/test/repo/commit/2020558fe2e34debb818a514715839cabd25e778) commit message - user1", pl.(*DingtalkPayload).ActionCard.Text)
assert.Equal(t, "[test/repo:test] 2 new commits", pl.(*DingtalkPayload).ActionCard.Title)
- assert.Equal(t, "view commit 2020558...2020558", pl.(*DingtalkPayload).ActionCard.SingleTitle)
+ assert.Equal(t, "view commits", pl.(*DingtalkPayload).ActionCard.SingleTitle)
assert.Equal(t, "http://localhost:3000/test/repo/src/test", parseRealSingleURL(pl.(*DingtalkPayload).ActionCard.SingleURL))
})