// @vitest-environment node import { describe, expect, it } from "vitest"; import harnessStoryContract from "../../tests/e2e/support/story-harness-contract.json"; describe("story harness contract", () => { it("uses unique story ids", () => { const storyIds = harnessStoryContract.stories.map((story) => story.id); expect(new Set(storyIds).size).toBe(storyIds.length); }); it("requires a reason for every curated story", () => { expect(harnessStoryContract.stories.every((story) => story.reason.trim().length > 0)).toBe(true); }); it("requires smoke scenarios for docs-smoke coverage", () => { expect( harnessStoryContract.stories .filter((story) => story.suites.includes("docs-smoke")) .every((story) => Boolean(story.smokeScenario)) ).toBe(true); }); it("keeps every story on at least one supported suite", () => { const supportedSuites = new Set(["a11y", "docs-smoke"]); expect( harnessStoryContract.stories.every( (story) => story.suites.length > 0 && story.suites.every((suite) => supportedSuites.has(suite)) ) ).toBe(true); }); });