test(總覽網頁): 把三條驗不出東西的斷言改成驗得出來的

- mermaid 那條原本只比對「有出現 mermaid 字樣」,而 CDN 網址裡就有這個字,
  整段渲染腳本刪掉也照樣通過。改成驗 mermaid.initialize 真的被呼叫。
- 新增一條守住例外的範圍:模板裡只能有那一段腳本,且不得夾帶網路或儲存操作。
- sdlc-plan 的七條斷言原本拿整份正本比對,任何一處撞到就算過。改成只看第 6 步,
  與 sdlc-analyze 那邊的做法一致。

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-17 14:21:44 +08:00
co-authored by Claude Opus 5
parent 854ce31d3d
commit bbf2f6b8b8
2 changed files with 34 additions and 11 deletions
+12
View File
@@ -327,3 +327,15 @@ test('總覽網頁與其他欄位可以一次送出', async (t) => {
assert.match(patches[0].body.body, /圖解版總覽/);
assert.equal(patches[0].body.due_date, '2026-09-24T00:00:00Z');
});
test('網址夾帶上一次寫回的提醒文字時擋下,免得那句話重複兩次', async (t) => {
const stub = await withStub(t);
const { json } = await run(
['--overview-url', 'https://example.com/a(此連結預設為私有,組織外無法開啟)'],
stub,
);
assert.equal(json.error.code, 'BAD_OVERVIEW_URL');
assert.equal(stub.requests.length, 0);
});