test(留言分頁): 改用 timeline 分頁讀取留言

Gitea 議題留言端點無法可靠處理分頁;改由 timeline 逐頁篩選 comment 事件並去重,讓抽取、整併與 PR 留言流程取得完整集合。
This commit is contained in:
2026-09-22 14:37:38 +08:00
parent a944141109
commit 437896348a
5 changed files with 66 additions and 42 deletions
+2 -2
View File
@@ -55,9 +55,9 @@ function routes(overrides = {}, { body = BODY, comments = [101, 102] } = {}) {
status: 200,
body: { number: INDEX, ...req.body, html_url: `https://x/${INDEX}` },
}),
[`GET /api/v1/repos/${REPO}/issues/${INDEX}/comments`]: {
[`GET /api/v1/repos/${REPO}/issues/${INDEX}/timeline`]: {
status: 200,
body: comments.map((id) => ({ id, body: `留言 ${id}`, user: { login: 'someone' } })),
body: comments.map((id) => ({ id, type: 'comment', body: `留言 ${id}`, user: { login: 'someone' } })),
},
});
for (const id of comments) {