import assert from "node:assert/strict";
import { test } from "vitest";
import { hasResumableDerivedState } from "../interrupted-session.js";

test("hasResumableDerivedState_rejects_blocked_state_without_active_work", () => {
	assert.equal(
		hasResumableDerivedState({
			activeMilestone: { id: "M005", title: "Blocked milestone" },
			activeSlice: null,
			activeTask: null,
			phase: "blocked",
		}),
		false,
	);
});

test("hasResumableDerivedState_accepts_active_non_blocked_state", () => {
	assert.equal(
		hasResumableDerivedState({
			activeMilestone: { id: "M005", title: "Active milestone" },
			activeSlice: { id: "S01", title: "Active slice" },
			activeTask: null,
			phase: "planning",
		}),
		true,
	);
});
