From c58dcb7230e6c8e4a9311a7a6afea042444d0a0f Mon Sep 17 00:00:00 2001 From: Mohammad Saddam Hossain Date: Sun, 8 Nov 2026 10:57:21 +0530 Subject: [PATCH] fix(report): hide the flaky trend chart when no run had flaky tests Refs #165. Co-Authored-By: Claude Sonnet 5.5 --- src/main/resources/report/partials/dashboard.html | 2 +- src/main/resources/report/report.js | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/resources/report/partials/dashboard.html b/src/main/resources/report/partials/dashboard.html index 6481345..b5f06a3 100644 --- a/src/main/resources/report/partials/dashboard.html +++ b/src/main/resources/report/partials/dashboard.html @@ -59,7 +59,7 @@
Suite Duration Trend (s)
-
+
Flaky Test Trend
diff --git a/src/main/resources/report/report.js b/src/main/resources/report/report.js index 23e8b64..214f128 100644 --- a/src/main/resources/report/report.js +++ b/src/main/resources/report/report.js @@ -118,7 +118,12 @@ if (window.Chart && trendData.length >= 2) { }); line('trendRateChart', 'Pass rate (%)', trendData.map(r => r.passRate), color('--good'), 100); line('trendTimeChart', 'Duration (s)', trendData.map(r => r.durationSec), color('--primary')); - line('trendFlakyChart', 'Flaky tests', trendData.map(r => r.flakyTests), color('--warn')); + // Hide the flaky card entirely when no run in the history had flaky tests. + if (trendData.some(r => r.flakyTests > 0)) { + line('trendFlakyChart', 'Flaky tests', trendData.map(r => r.flakyTests), color('--warn')); + } else { + document.getElementById('trendFlakyCard').style.display = 'none'; + } } // ── Collapse / expand class groups ──