From acb76fee167b9ba0f1f96a40ae313ba07f4f1c13 Mon Sep 17 00:00:00 2001 From: Lex Christopherson Date: Mon, 23 Feb 2026 09:35:00 -0600 Subject: [PATCH] test: add TBD guard coverage for phase_req_ids extraction Co-Authored-By: Claude Opus 4.6 --- tests/init.test.cjs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/init.test.cjs b/tests/init.test.cjs index 8ac9382a4..dabd289ab 100644 --- a/tests/init.test.cjs +++ b/tests/init.test.cjs @@ -168,6 +168,20 @@ describe('init commands', () => { assert.strictEqual(output.phase_req_ids, 'EX-01, EX-02'); }); + test('init plan-phase returns null phase_req_ids when value is TBD', () => { + fs.mkdirSync(path.join(tmpDir, '.planning', 'phases', '03-api'), { recursive: true }); + fs.writeFileSync( + path.join(tmpDir, '.planning', 'ROADMAP.md'), + `# Roadmap\n\n### Phase 3: API\n**Goal:** Build API\n**Requirements**: TBD\n**Plans:** 0 plans\n` + ); + + const result = runGsdTools('init plan-phase 3', tmpDir); + assert.ok(result.success, `Command failed: ${result.error}`); + + const output = JSON.parse(result.output); + assert.strictEqual(output.phase_req_ids, null, 'TBD placeholder should return null'); + }); + test('init execute-phase returns null phase_req_ids when Requirements line is absent', () => { const phaseDir = path.join(tmpDir, '.planning', 'phases', '03-api'); fs.mkdirSync(phaseDir, { recursive: true });