fix(3153): handle numeric 100 percent and block-list next_phases

This commit is contained in:
Tom Boucher
2026-05-05 18:34:42 -04:00
parent 8adfe4de01
commit dbc09d21a6
3 changed files with 44 additions and 7 deletions

View File

@@ -125,6 +125,21 @@ describe('parseStateMd', () => {
assert.equal(s.status, undefined);
assert.equal(s.phaseNum, undefined);
});
test('parses next_phases from YAML block-list form (#3153)', () => {
const content = [
'---',
'next_action: execute',
'next_phases:',
' - 4.5',
' - 4.6',
'---',
].join('\n');
const s = parseStateMd(content);
assert.equal(s.nextAction, 'execute');
assert.deepEqual(s.nextPhases, ['4.5', '4.6']);
});
});
// ─── formatGsdState ─────────────────────────────────────────────────────────
@@ -185,6 +200,14 @@ describe('formatGsdState', () => {
assert.equal(out, 'Foundations · planning');
});
test('treats numeric 100 percent as milestone complete (#3153)', () => {
const out = formatGsdState({
milestone: 'v2.0',
percent: 100,
});
assert.equal(out, 'v2.0 [██████████] 100% · milestone complete');
});
test('returns empty string for empty state', () => {
assert.equal(formatGsdState({}), '');
});