v0.2.0: Git-native architecture (#1)
This commit was merged in pull request #1.
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
import {
|
||||
PipelineStage,
|
||||
PipelineState,
|
||||
PhaseResult,
|
||||
STAGE_ORDER,
|
||||
getNextStage,
|
||||
createInitialPipelineState,
|
||||
} from "../types/pipeline.js";
|
||||
|
||||
describe("STAGE_ORDER", () => {
|
||||
it("has 7 stages in correct order", () => {
|
||||
expect(STAGE_ORDER).toEqual([
|
||||
"specify",
|
||||
"clarify",
|
||||
"research",
|
||||
"plan",
|
||||
"execute",
|
||||
"verify",
|
||||
"complete",
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("getNextStage", () => {
|
||||
it("returns the next stage in sequence", () => {
|
||||
expect(getNextStage("specify")).toBe("clarify");
|
||||
expect(getNextStage("clarify")).toBe("research");
|
||||
expect(getNextStage("research")).toBe("plan");
|
||||
expect(getNextStage("plan")).toBe("execute");
|
||||
expect(getNextStage("execute")).toBe("verify");
|
||||
expect(getNextStage("verify")).toBe("complete");
|
||||
});
|
||||
|
||||
it("returns null for the last stage", () => {
|
||||
expect(getNextStage("complete")).toBeNull();
|
||||
});
|
||||
|
||||
it("returns null for unknown stage", () => {
|
||||
expect(getNextStage("unknown" as PipelineStage)).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
describe("createInitialPipelineState", () => {
|
||||
it("creates a valid initial state", () => {
|
||||
const state = createInitialPipelineState("/test/project");
|
||||
expect(state.project_path).toBe("/test/project");
|
||||
expect(state.current_stage).toBe("specify");
|
||||
expect(state.current_phase).toBe(0);
|
||||
expect(state.specification_loaded).toBe(false);
|
||||
expect(state.clarify_completed).toBe(false);
|
||||
expect(state.research_completed).toBe(false);
|
||||
expect(state.plan_completed).toBe(false);
|
||||
expect(state.execute_completed).toBe(false);
|
||||
expect(state.verify_completed).toBe(false);
|
||||
expect(state.errors).toHaveLength(0);
|
||||
expect(state.started_at).toBeTruthy();
|
||||
expect(state.last_updated).toBeTruthy();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user