Add fixtures, Storybook stories, tests + screenshots for C3 verdict card

- Fixtures: pending (S1/S2), partial (S3/S4), complete (S5), superseded (S6),
  many-items (S7) request_item_verdicts interactions.
- Storybook: interactive draft->apply story + terminal-state stories under
  Chat & Comments/Issue Thread Interactions.
- Tests: getItemVerdictProgress + buildItemVerdictsSummary (lib) and card
  render/apply/reason-gate/terminal/superseded (component). 40 related tests green.
- scripts/screenshot-verdicts.mjs + screenshots/pap-13249 (S1/S2,S4,S5,S6,S7 at
  1440x900 and 390x844, light + dark).

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-07-10 20:08:05 +00:00
1 parent 8d7fb594f2
commit 8804ee9bba
26 files changed
+562 -2

No files matched your search

+53
View File
@@ -0,0 +1,53 @@
#!/usr/bin/env node
// Screenshot the C3 per-item verdict card stories (PAP-13249) at both
// viewports and both themes against a served storybook-static (see PAP-13249).
import fs from "node:fs/promises";
import path from "node:path";
import { chromium } from "@playwright/test";
const BASE = "http://localhost:6102/iframe.html";
const PREFIX = "chat-comments-issue-thread-interactions";
const OUT_DIR = process.argv[2] || "screenshots/pap-13249";
const stories = [
{ id: "item-verdicts-pending", label: "s1-s2-pending" },
{ id: "item-verdicts-partial", label: "s4-partial" },
{ id: "item-verdicts-complete", label: "s5-complete" },
{ id: "item-verdicts-superseded", label: "s6-superseded" },
{ id: "item-verdicts-many-items", label: "s7-many" },
];
const viewports = [
{ name: "desktop", width: 1440, height: 900 },
{ name: "mobile", width: 390, height: 844 },
];
const themes = ["light", "dark"];
await fs.mkdir(path.resolve(OUT_DIR), { recursive: true });
const executablePath = process.env.CHROME_BIN || undefined;
const browser = await chromium.launch({
headless: true,
executablePath,
args: ["--no-sandbox", "--headless=new"],
});
try {
for (const vp of viewports) {
for (const theme of themes) {
const ctx = await browser.newContext({
viewport: { width: vp.width, height: vp.height },
deviceScaleFactor: 2,
});
const page = await ctx.newPage();
for (const story of stories) {
const url = `${BASE}?id=${PREFIX}--${story.id}&viewMode=story&globals=theme:${theme}`;
await page.goto(url, { waitUntil: "networkidle" });
await page.waitForTimeout(800);
const out = path.join(OUT_DIR, `${story.label}_${vp.name}_${theme}.png`);
await page.screenshot({ path: out, fullPage: true });
console.log(`Wrote ${out}`);
}
await ctx.close();
}
}
} finally {
await browser.close();
}