test: add init tests for has_reviews and reviews_path
- Test that has_reviews=true and reviews_path is set when REVIEWS.md exists - Test that reviews_path is undefined and has_reviews=false when missing Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -86,6 +86,19 @@ describe('init commands', () => {
|
|||||||
assert.strictEqual(output.uat_path, '.planning/phases/03-api/03-UAT.md');
|
assert.strictEqual(output.uat_path, '.planning/phases/03-api/03-UAT.md');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('init plan-phase detects has_reviews and reviews_path when REVIEWS.md exists', () => {
|
||||||
|
const phaseDir = path.join(tmpDir, '.planning', 'phases', '03-api');
|
||||||
|
fs.mkdirSync(phaseDir, { recursive: true });
|
||||||
|
fs.writeFileSync(path.join(phaseDir, '03-REVIEWS.md'), '# Cross-AI Reviews');
|
||||||
|
|
||||||
|
const result = runGsdTools('init plan-phase 03', tmpDir);
|
||||||
|
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||||
|
|
||||||
|
const output = JSON.parse(result.output);
|
||||||
|
assert.strictEqual(output.has_reviews, true);
|
||||||
|
assert.strictEqual(output.reviews_path, '.planning/phases/03-api/03-REVIEWS.md');
|
||||||
|
});
|
||||||
|
|
||||||
test('init plan-phase omits optional paths if files missing', () => {
|
test('init plan-phase omits optional paths if files missing', () => {
|
||||||
const phaseDir = path.join(tmpDir, '.planning', 'phases', '03-api');
|
const phaseDir = path.join(tmpDir, '.planning', 'phases', '03-api');
|
||||||
fs.mkdirSync(phaseDir, { recursive: true });
|
fs.mkdirSync(phaseDir, { recursive: true });
|
||||||
@@ -96,6 +109,8 @@ describe('init commands', () => {
|
|||||||
const output = JSON.parse(result.output);
|
const output = JSON.parse(result.output);
|
||||||
assert.strictEqual(output.context_path, undefined);
|
assert.strictEqual(output.context_path, undefined);
|
||||||
assert.strictEqual(output.research_path, undefined);
|
assert.strictEqual(output.research_path, undefined);
|
||||||
|
assert.strictEqual(output.reviews_path, undefined);
|
||||||
|
assert.strictEqual(output.has_reviews, false);
|
||||||
});
|
});
|
||||||
|
|
||||||
// ── phase_req_ids extraction (fix for #684) ──────────────────────────────
|
// ── phase_req_ids extraction (fix for #684) ──────────────────────────────
|
||||||
|
|||||||
Reference in New Issue
Block a user