From 2ca0efe423076682b07309820f394e09ba596d63 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 26 Aug 2026 10:40:15 +0000 Subject: [PATCH 1/3] Initial plan From 058c849ea293f14214734e4c3447772d350cc749 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 26 Aug 2026 10:43:27 +0000 Subject: [PATCH 2/3] Test SVG colors in light theme Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com> --- tests/unit/workflow-contract.test.mjs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/unit/workflow-contract.test.mjs b/tests/unit/workflow-contract.test.mjs index e504889..79818f3 100644 --- a/tests/unit/workflow-contract.test.mjs +++ b/tests/unit/workflow-contract.test.mjs @@ -674,4 +674,28 @@ test("Pages is an explicit least-privilege add-on", () => { assert.ok(existsSync(join(root, ".github", "scripts", "pages-report", assetName)), `missing report script ${assetName}`); assert.match(pagesWorkflow, new RegExp(`\\.github/scripts/pages-report/${assetName.replace(".", "\\.")}`)); } +}); + +test("Pages report SVGs use theme colors in light and dark modes", () => { + const report = readFileSync(join(root, ".github", "scripts", "pages-report", "report.mjs"), "utf8"); + const darkTheme = report.match(/:root \{([\s\S]*?)\n\}/)?.[1]; + const lightTheme = report.match(/@media \(prefers-color-scheme: light\) \{\s*:root \{([\s\S]*?)\n \}/)?.[1]; + + assert.ok(darkTheme, "missing default dark theme"); + assert.ok(lightTheme, "missing light theme"); + + for (const [name, svgClass] of [ + ["success", "chart-successful"], + ["danger", "chart-failed"], + ["cancelled", "chart-cancelled"], + ]) { + const variable = new RegExp(`--${name}: #[0-9a-f]{6};`, "i"); + assert.match(darkTheme, variable); + assert.match(lightTheme, variable); + assert.match(report, new RegExp(`\\.${svgClass} \\{ stroke: var\\(--${name}\\);`)); + } + + assert.match(report, / Date: Wed, 26 Aug 2026 10:43:54 +0000 Subject: [PATCH 3/3] Harden SVG theme test selector Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com> --- tests/unit/workflow-contract.test.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/workflow-contract.test.mjs b/tests/unit/workflow-contract.test.mjs index 79818f3..9fdeffc 100644 --- a/tests/unit/workflow-contract.test.mjs +++ b/tests/unit/workflow-contract.test.mjs @@ -692,7 +692,7 @@ test("Pages report SVGs use theme colors in light and dark modes", () => { const variable = new RegExp(`--${name}: #[0-9a-f]{6};`, "i"); assert.match(darkTheme, variable); assert.match(lightTheme, variable); - assert.match(report, new RegExp(`\\.${svgClass} \\{ stroke: var\\(--${name}\\);`)); + assert.match(report, new RegExp(`\\.${svgClass}\\s*\\{\\s*stroke:\\s*var\\(--${name}\\)`)); } assert.match(report, /