Skip to content

Commit 9b66f56

Browse files
committed
test: align fixtures with lifecycle-based task model
1 parent 908a297 commit 9b66f56

5 files changed

Lines changed: 18 additions & 168 deletions

File tree

tests/infer-completeness.unit.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,14 @@ describe("inferCompletenessOp", () => {
9595
assert.ok(chg1.issues.some((i) => i.includes("no scope")));
9696
});
9797

98-
it("returns 1.0 score for change with decision link and plan", () => {
98+
it("returns 1.0 score for change with decision link and scope", () => {
9999
const doc: SysProMDocument = {
100100
nodes: [
101101
{
102102
id: "CHG1",
103103
type: "change",
104104
name: "Test Change",
105105
scope: ["INT1"],
106-
plan: [{ description: "Step 1", done: true }],
107106
},
108107
{ id: "DEC1", type: "decision", name: "Test Decision" },
109108
],

tests/json-to-md.unit.test.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,7 @@ function full(): SysProMDocument {
122122
description: "A change.",
123123
scope: ["ELEM1"],
124124
operations: [{ type: "add", target: "ELEM1" }],
125-
plan: [
126-
{ description: "Step one", done: true },
127-
{ description: "Step two", done: false },
128-
],
129-
lifecycle: { defined: true, introduced: true, complete: false },
125+
lifecycle: { defined: true, introduced: true, in_progress: true },
130126
},
131127
{
132128
id: "VIEW1",
@@ -327,8 +323,9 @@ describe("json-to-md single file", () => {
327323
assert.ok(md.includes("- ELEM1"));
328324
assert.ok(md.includes("Operations:"));
329325
assert.ok(md.includes("- add ELEM1"));
330-
assert.ok(md.includes("- [x] Step one"));
331-
assert.ok(md.includes("- [ ] Step two"));
326+
assert.ok(md.includes("### Lifecycle"));
327+
assert.ok(md.includes("- [x] introduced"));
328+
assert.ok(md.includes("- [x] in progress"));
332329
});
333330

334331
it("renders relationships", () => {
@@ -478,12 +475,13 @@ describe("json-to-md multi-doc", () => {
478475
assert.ok(dec.includes("- [x] proposed"));
479476
});
480477

481-
it("CHANGES.md contains change with plan", () => {
478+
it("CHANGES.md contains change lifecycle", () => {
482479
jsonToMarkdownMultiDoc(full(), tmpDir);
483480
const chg = readFileSync(join(tmpDir, "CHANGES.md"), "utf8");
484481
assert.ok(chg.includes("### CHG1 — Test Change"));
485-
assert.ok(chg.includes("- [x] Step one"));
486-
assert.ok(chg.includes("- [ ] Step two"));
482+
assert.ok(chg.includes("### Lifecycle"));
483+
assert.ok(chg.includes("- [x] introduced"));
484+
assert.ok(chg.includes("- [x] in progress"));
487485
});
488486

489487
it("renders node relationships in the correct file", () => {

tests/roundtrip.unit.test.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,7 @@ function fixture(): SysProMDocument {
9393
description: "A change.",
9494
scope: ["ELEM1"],
9595
operations: [{ type: "add", target: "ELEM1" }],
96-
plan: [
97-
{ description: "Step one", done: true },
98-
{ description: "Step two", done: false },
99-
],
100-
lifecycle: { defined: true, introduced: true, complete: false },
96+
lifecycle: { defined: true, introduced: true, in_progress: true },
10197
},
10298
{
10399
id: "VIEW1",
@@ -168,10 +164,13 @@ function assertChangeFields(result: SysProMDocument) {
168164
assert.ok(ch1, "CHG1 missing");
169165
assert.ok(ch1.scope, "CHG1 missing scope");
170166
assert.ok(ch1.scope.includes("ELEM1"), "CHG1 scope should include ELEM1");
171-
assert.ok(ch1.plan, "CHG1 missing plan");
172-
assert.equal(ch1.plan.length, 2, "CHG1 should have 2 plan items");
173-
assert.equal(ch1.plan[0].done, true, "CHG1 plan[0] should be done");
174-
assert.equal(ch1.plan[1].done, false, "CHG1 plan[1] should not be done");
167+
assert.ok(ch1.lifecycle, "CHG1 missing lifecycle");
168+
assert.equal(ch1.lifecycle.defined, true, "CHG1 lifecycle.defined mismatch");
169+
assert.equal(
170+
ch1.lifecycle.in_progress,
171+
true,
172+
"CHG1 lifecycle.in_progress mismatch",
173+
);
175174
}
176175

177176
function assertLifecycle(result: SysProMDocument) {

tests/schema.unit.test.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ describe("decision nodes", () => {
209209
});
210210

211211
describe("change nodes", () => {
212-
it("accepts full change with scope, operations, plan, propagation", () => {
212+
it("accepts full change with scope, operations, propagation", () => {
213213
valid({
214214
nodes: [
215215
{
@@ -223,11 +223,6 @@ describe("change nodes", () => {
223223
{ type: "remove", target: "ELEM2" },
224224
{ type: "link", description: "Link ELEM3 to CAP1" },
225225
],
226-
plan: [
227-
{ description: "Design interface", done: true },
228-
{ description: "Implement", done: false },
229-
{ description: "Test" },
230-
],
231226
propagation: {
232227
concept: true,
233228
structure: true,

tests/task-cli.unit.test.ts

Lines changed: 0 additions & 141 deletions
This file was deleted.

0 commit comments

Comments
 (0)