fix: add non-null assertions for parseUnitId optional fields in tests

parseUnitId returns { milestone, slice?, task? } where slice and task are
optional. Test code that knows these fields are present needs ! assertions
to satisfy strict TypeScript checking.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Lex Christopherson 2026-03-26 09:29:50 -06:00
parent bfce186fee
commit 6c6de6aa2d
2 changed files with 2 additions and 2 deletions

View file

@ -447,7 +447,7 @@ test("unitId batch encoding round-trips correctly", () => {
assert.equal(slice, "S01");
const plusIdx = batchPart!.indexOf("+");
assert.ok(plusIdx > 0, "Should have + separator");
const batchIds = batchPart.slice(plusIdx + 1).split(",");
const batchIds = batchPart!.slice(plusIdx + 1).split(",");
assert.deepEqual(batchIds, ["T02", "T03", "T05"]);
});

View file

@ -267,7 +267,7 @@ test('Retry reset: idempotent when artifacts already missing', () => {
const { milestone: mid, slice: sid, task: tid } = parseUnitId(trigger.unitId);
// Uncheck — returns false because no PLAN file
const uncheckResult = uncheckTaskInPlan(base, mid, sid, tid);
const uncheckResult = uncheckTaskInPlan(base, mid, sid!, tid!);
assert.ok(!uncheckResult, "uncheck returns false when no PLAN exists");
// Summary does not exist — no crash