From 0882b82750e6f370608b8f836b291f71803f93f3 Mon Sep 17 00:00:00 2001 From: Jia him Date: Sun, 30 Aug 2026 13:00:49 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[AI]=20test:=20=E9=81=BF=E5=85=8D=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=E5=9B=BA=E5=AE=9A=E7=BF=BB=E8=AF=91=E6=96=87=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web/tests/document-content.test.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/web/tests/document-content.test.ts b/apps/web/tests/document-content.test.ts index 6b6444d..96da1d0 100644 --- a/apps/web/tests/document-content.test.ts +++ b/apps/web/tests/document-content.test.ts @@ -84,9 +84,15 @@ test("renders every document header in title, timestamps, source notice, body or assert.ok(titleIndex < timestampsIndex); assert.ok(timestampsIndex < sourceNoticeIndex); assert.ok(sourceNoticeIndex < bodyIndex); + const firstBodyParagraph = /

([\\s\\S]*?)<\\/p>/u + .exec(html.slice(bodyIndex))?.[1] + ?.replace(/<[^>]+>/gu, "") + .trim(); + assert.ok(firstBodyParagraph); + assert.ok(firstBodyParagraph.length >= 20); assert.equal( - html.match(/新南威尔士州国家气象局/gu)?.length, - 1, + html.slice(0, bodyIndex).includes(firstBodyParagraph), + false, "article body must not be duplicated into the document header", ); assert.match(html, /translation-status-badge/u); From b9842e14cd674cb631f98226cea8be953afd72e2 Mon Sep 17 00:00:00 2001 From: Jia him Date: Sun, 30 Aug 2026 13:02:19 +0800 Subject: [PATCH 2/2] =?UTF-8?q?[AI]=20test:=20=E4=BF=AE=E6=AD=A3=E6=AD=A3?= =?UTF-8?q?=E6=96=87=E6=8E=A2=E9=92=88=E6=AD=A3=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web/tests/document-content.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/tests/document-content.test.ts b/apps/web/tests/document-content.test.ts index 96da1d0..1a58c4b 100644 --- a/apps/web/tests/document-content.test.ts +++ b/apps/web/tests/document-content.test.ts @@ -84,7 +84,7 @@ test("renders every document header in title, timestamps, source notice, body or assert.ok(titleIndex < timestampsIndex); assert.ok(timestampsIndex < sourceNoticeIndex); assert.ok(sourceNoticeIndex < bodyIndex); - const firstBodyParagraph = /

([\\s\\S]*?)<\\/p>/u + const firstBodyParagraph = /

([\s\S]*?)<\/p>/u .exec(html.slice(bodyIndex))?.[1] ?.replace(/<[^>]+>/gu, "") .trim();