feat/wp-schedule-and-board/main #31

Merged
admin merged 17 commits from feat/wp-schedule-and-board/main into master 2026-09-17 06:09:42 +00:00
Showing only changes of commit 97d0afac38 - Show all commits
+9 -4
View File
@@ -131,15 +131,20 @@ test('已經在目標看板上時不重發 PATCH', async (t) => {
// ── 不建立專案 ─────────────────────────────────────────────────────
test('不建立專案:沒有任何非 GET 請求打到專案相關端點', async (t) => {
test('不建立專案:唯一的寫入是議題本身的 PATCH,且只帶 projects', async (t) => {
// 用「路徑含 project」當條件是空話——Gitea 的專案根本沒有 API 路徑
const stub = await withStub(t);
await run(['--project', '開發看板'], stub);
const creations = stub.requests.filter(
(r) => r.method !== 'GET' && /project/i.test(r.path),
// 前置檢查的寫入權探針也是 PATCH,但它打在不存在的 /issues/0 上,不算真正的寫入
const writes = stub.requests.filter(
(r) => r.method !== 'GET' && !r.path.endsWith('/issues/0'),
);
assert.deepEqual(creations, []);
assert.equal(writes.length, 1);
assert.equal(writes[0].method, 'PATCH');
assert.equal(writes[0].path, `/api/v1/repos/${REPO}/issues/${INDEX}`);
assert.deepEqual(Object.keys(writes[0].body), ['projects']);
});
// ── --dry-run ─────────────────────────────────────────────────────