diff --git a/wechat-news-morning-draft-worker.test.mjs b/wechat-news-morning-draft-worker.test.mjs index 309cb9b..bbe4e38 100644 --- a/wechat-news-morning-draft-worker.test.mjs +++ b/wechat-news-morning-draft-worker.test.mjs @@ -12,6 +12,8 @@ import { const SAMPLE_HTML = `

📰 每日新闻早报

`; +const HEALTHY_TODAY_HTML = `${SAMPLE_HTML}${'

条目

'.repeat(8)}`; + function createPool() { const rows = []; return { @@ -104,7 +106,7 @@ test('runOnce honors forceGenerateOnce even when today page exists', async () => const userId = 'user-news'; const publicDir = path.join(tmpRoot, PUBLISH_ROOT_DIR, userId, PUBLIC_ZONE_DIR); fs.mkdirSync(publicDir, { recursive: true }); - fs.writeFileSync(path.join(publicDir, 'daily-news-0911.html'), SAMPLE_HTML); + fs.writeFileSync(path.join(publicDir, 'daily-news-0911.html'), HEALTHY_TODAY_HTML); const pool = createPool(); const service = createWechatNewsMorningDraftService(pool, { diff --git a/wechat-news-morning-draft.test.mjs b/wechat-news-morning-draft.test.mjs index d3b227b..c3547a9 100644 --- a/wechat-news-morning-draft.test.mjs +++ b/wechat-news-morning-draft.test.mjs @@ -164,8 +164,8 @@ test('news morning draft service persists config and records failed push', async const preview = await service.preview({ now: Date.parse('2026-09-10T08:00:00+08:00') }); assert.equal(preview.page.slug, 'daily-news-0910'); - assert.match(preview.template.spec, /0910|2026-09-10/u); - assert.match(preview.template.spec, /禁止复制/u); + assert.match(preview.template.spec, /0915|global|Google/u); + assert.match(preview.template.spec, /禁止复制|禁止用历史 daily-news/u); await assert.rejects( () => service.pushDraft({ @@ -212,10 +212,11 @@ test('buildNewsMorningAutoGenerationTask requires fresh daily search', () => { assert.match(task.taskSpec, /禁止复制/u); assert.match(task.taskSpec, /tkmind_search/u); assert.match(task.taskSpec, /web_search/u); - assert.match(task.taskSpec, /国内热点/u); - assert.match(task.taskSpec, /国际热点/u); - assert.match(task.taskSpec, /热门事件/u); - assert.match(task.taskSpec, /热门旅游城市/u); + assert.match(task.taskSpec, /国内/u); + assert.match(task.taskSpec, /国际/u); + assert.match(task.taskSpec, /Google/u); + assert.match(task.taskSpec, /全球高校/u); + assert.match(task.taskSpec, /全球股市/u); assert.match(task.taskSpec, /2026-09-15/u); assert.match(task.taskSpec, /daily-news-0915\.html/u); assert.doesNotMatch(task.taskSpec, /可以用昨日正文/u);