diff --git a/src/pages/Dashboard.print.test.ts b/src/pages/Dashboard.print.test.ts new file mode 100644 index 0000000..4c6db8a --- /dev/null +++ b/src/pages/Dashboard.print.test.ts @@ -0,0 +1,21 @@ +import fs from "node:fs"; +import path from "node:path"; + +describe("Dashboard print presentation", () => { + const dashboardPath = path.join(process.cwd(), "src/pages/Dashboard.tsx"); + const printCssPath = path.join(process.cwd(), "src/styles/print.css"); + + it("provides a print stylesheet for Dashboard", () => { + const css = fs.readFileSync(printCssPath, "utf8"); + expect(css).toContain("@media print"); + expect(css).toContain(".dashboard-chrome"); + expect(css).toContain("display: none !important"); + }); + + it("connects Dashboard to the print stylesheet", () => { + const component = fs.readFileSync(dashboardPath, "utf8"); + expect(component).toContain('import "../styles/print.css";'); + expect(component).toContain("dashboard-container"); + expect(component).toContain("dashboard-chrome"); + }); +}); \ No newline at end of file diff --git a/src/pages/Dashboard.tsx b/src/pages/Dashboard.tsx index 617c56d..e1e3729 100644 --- a/src/pages/Dashboard.tsx +++ b/src/pages/Dashboard.tsx @@ -1,5 +1,6 @@ import React from "react" import { StellarWaveEmptyState } from "../components/EmptyState" +import "../styles/print.css"; /** * Dashboard page component (Legacy Pages Router). @@ -18,6 +19,11 @@ import { StellarWaveEmptyState } from "../components/EmptyState" * layer (src/styles/focus.css) for WCAG 2.1 AA 3:1 contrast ratio. * - Tap targets: All interactive elements maintain ≥44×44px minimum * (WCAG 2.5.5) via Button size="lg" in the StellarWaveEmptyState. + * + * Issue #805: Add print stylesheet section for Dashboard. + * - Chrome (navigation + interactive controls) is hidden via .dashboard-chrome. + * - Collapsible sections are expanded when printing so the printed Dashboard + * shows all content without requiring user interaction. */ export default function Dashboard() { return ( @@ -30,7 +36,9 @@ export default function Dashboard() {