diff --git a/Auto Run Docs/SpecKit-web-header-analyzer-Phase-06-Interactive-Report.md b/Auto Run Docs/SpecKit-web-header-analyzer-Phase-06-Interactive-Report.md index f94ad25..d20c4ef 100644 --- a/Auto Run Docs/SpecKit-web-header-analyzer-Phase-06-Interactive-Report.md +++ b/Auto Run Docs/SpecKit-web-header-analyzer-Phase-06-Interactive-Report.md @@ -54,7 +54,7 @@ ReportContainer - [x] Security appliances show as badges; empty state handled gracefully - [x] Search filters results in real-time across test name, header name, and analysis text - [x] Export JSON produces a valid JSON file containing all results -- [ ] Export HTML produces a styled standalone page viewable in any browser +- [x] Export HTML produces a styled standalone page viewable in any browser - [ ] All report components are keyboard accessible - [ ] Linting passes (`npx eslint src/`, `npx prettier --check src/`) - [ ] Run `/speckit.analyze` to verify consistency diff --git a/frontend/src/__tests__/report/ReportExport.test.tsx b/frontend/src/__tests__/report/ReportExport.test.tsx index ee46b24..3e847d0 100644 --- a/frontend/src/__tests__/report/ReportExport.test.tsx +++ b/frontend/src/__tests__/report/ReportExport.test.tsx @@ -136,7 +136,7 @@ describe("ReportExport", () => { expect(createObjectUrlSpy).toHaveBeenCalled(); expect(clickSpy).toHaveBeenCalled(); expect(lastBlob).not.toBeNull(); - expect(lastBlob?.type).toBe("application/json"); + expect(lastBlob?.type).toBe("application/json;charset=utf-8"); const text = await lastBlob?.text(); const parsed = JSON.parse(text ?? "{}") as AnalysisReport; @@ -144,7 +144,7 @@ describe("ReportExport", () => { expect(parsed.results[0]?.testId).toBe(101); }); - it("triggers an HTML download", () => { + it("triggers an HTML download with styled markup", async () => { const { container } = render(); const htmlButton = getByTestId(container, "report-export-html"); @@ -155,5 +155,13 @@ describe("ReportExport", () => { expect(createObjectUrlSpy).toHaveBeenCalled(); expect(clickSpy).toHaveBeenCalled(); + expect(lastBlob?.type).toBe("text/html;charset=utf-8"); + + const text = await lastBlob?.text(); + expect(text).toContain(""); + expect(text).toContain("