File size: 1,796 Bytes
837e3ac
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import { renderToStaticMarkup } from "react-dom/server";
import { describe, expect, it, vi } from "vitest";
import type { WorkPackage } from "@/lib/work-package-types";
import { WorkPackageDetail } from "./WorkPackageDetail";

const workPackage: WorkPackage = {
  id: "wp-srs",
  title: "System Requirements Specification",
  shortName: "SRS",
  phase: "Specify Product",
  objective:
    "Translate CRS into traceable system-level requirements, components, interfaces, specifications, and verification methods.",
  inputFiles: ["Product brief", "CRS traceability input"],
  outputFiles: ["System Requirements Specification"],
  coreSections: ["Verification Method", "Acceptance Criteria"],
  tasks: [
    {
      id: "task-1",
      title: "Translate CRS into system requirements",
      description: "Produce traceable system-level requirements with verification logic.",
      type: "generation",
      executable: true,
      status: "todo",
    },
  ],
  outputs: [
    {
      id: "out-1",
      title: "SRS Draft",
      type: "table",
      content: "Verification Method means how the requirement will be checked.",
      createdAt: "2026-01-01T00:00:00.000Z",
      executionMode: "simulated",
      disclaimer: "Simulated.",
    },
  ],
  status: "todo",
  priority: "high",
};

describe("WorkPackageDetail", () => {
  it("renders ask-about-this controls for detailed package content", () => {
    const html = renderToStaticMarkup(
      <WorkPackageDetail
        workPackage={workPackage}
        onPrefill={vi.fn()}
        onBack={vi.fn()}
      />,
    );

    expect(html).toContain("Ask about objective");
    expect(html).toContain("Ask about latest output");
    expect(html).toContain("Ask about this paragraph");
    expect(html).toContain("Ask about this task");
  });
});