From b8da0a2652950c12391eb19ac78cdf39bce55c56 Mon Sep 17 00:00:00 2001 From: Robert Joonas Date: Tue, 19 May 2026 11:50:36 +0300 Subject: [PATCH 1/4] add graph e2e tests --- assets/js/dashboard/components/graph.tsx | 9 +- .../js/dashboard/stats/graph/main-graph.tsx | 25 +- e2e/tests/dashboard/main-graph.spec.ts | 289 ++++++++++++++++++ e2e/tests/fixtures.ts | 1 + 4 files changed, 317 insertions(+), 7 deletions(-) create mode 100644 e2e/tests/dashboard/main-graph.spec.ts diff --git a/assets/js/dashboard/components/graph.tsx b/assets/js/dashboard/components/graph.tsx index 8a2d1ed00343..85fa23743707 100644 --- a/assets/js/dashboard/components/graph.tsx +++ b/assets/js/dashboard/components/graph.tsx @@ -280,7 +280,8 @@ function InnerGraph({ svg, series, x: point.x, - y: point.values[seriesIndex] + y: point.values[seriesIndex], + bucketIndex: i }) points[i] = { ...point, @@ -800,6 +801,7 @@ function drawLine({ svg .append('path') .attr('class', classNames(className)) + .attr('data-testid', 'graph-line') .datum(datum) .attr('d', line) } @@ -808,12 +810,14 @@ function drawDot({ svg, series, x, - y + y, + bucketIndex }: { svg: SelectedSVG series: SeriesConfig x: number y: number | null + bucketIndex: number }): SelectedGroup { const group = svg.append('g').attr('class', 'group') if (series.dot && y !== null) { @@ -822,6 +826,7 @@ function drawDot({ .attr('r', 2.5) .attr('class', series.dot.dotClassName) .attr('transform', `translate(${x},${y})`) + .attr('data-testid', `graph-dot-group-${bucketIndex}`) } return group } diff --git a/assets/js/dashboard/stats/graph/main-graph.tsx b/assets/js/dashboard/stats/graph/main-graph.tsx index aeb5142ceecd..185716925a09 100644 --- a/assets/js/dashboard/stats/graph/main-graph.tsx +++ b/assets/js/dashboard/stats/graph/main-graph.tsx @@ -463,9 +463,15 @@ const MainGraphTooltip = ({ typeof onClick !== 'function' && 'pointer-events-none' )} > -