Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Align History regressions with wrapped tooltips and empty announcements

pulse-triage[bot]65a36dd4e7a8
diff --git a/frontend-modern/src/components/shared/__tests__/HistoryChart.test.tsx b/frontend-modern/src/components/shared/__tests__/HistoryChart.test.tsx
index fc4ba20ffa..19aa1eb53c 100644
--- a/frontend-modern/src/components/shared/__tests__/HistoryChart.test.tsx
+++ b/frontend-modern/src/components/shared/__tests__/HistoryChart.test.tsx
@@ -150,7 +150,7 @@ describe('HistoryChart', () => {
const canvas = screen.getByRole('img', { name: 'History chart' });
const announcement = container.querySelector('[aria-live="polite"]')!;
expect(canvas).toHaveAttribute('tabindex', '0');
- expect(announcement).toBeEmptyDOMElement();
+ expect(announcement.textContent).toBe('');
fireEvent.focus(canvas);
expect(announcement).toHaveTextContent('30.0%');
fireEvent.keyDown(canvas, { key: 'ArrowLeft' });
@@ -164,20 +164,20 @@ describe('HistoryChart', () => {
fireEvent.keyDown(canvas, { key: 'ArrowRight' });
expect(announcement).toHaveTextContent('30.0%');
fireEvent.keyDown(canvas, { key: 'Escape' });
- expect(announcement).toBeEmptyDOMElement();
+ expect(announcement.textContent).toBe('');
expect(container.querySelector('[data-history-chart-tooltip]')).toBeNull();
fireEvent.keyDown(canvas, { key: 'Home' });
setPoints(points().map((point) => ({ ...point, value: point.value + 1 })));
expect(announcement).toHaveTextContent('11.0%');
setTarget('b');
- expect(announcement).toBeEmptyDOMElement();
+ expect(announcement.textContent).toBe('');
fireEvent.keyDown(canvas, { key: 'Home' });
fireEvent.blur(canvas);
- expect(announcement).toBeEmptyDOMElement();
+ expect(announcement.textContent).toBe('');
setPoints([]);
fireEvent.focus(canvas);
fireEvent.keyDown(canvas, { key: 'End' });
- expect(announcement).toBeEmptyDOMElement();
+ expect(announcement.textContent).toBe('');
});
it('renders the default history label', () => {
diff --git a/frontend-modern/src/components/shared/__tests__/historyChartModel.branchcov2.test.ts b/frontend-modern/src/components/shared/__tests__/historyChartModel.branchcov2.test.ts
index a5f6bda044..76f4c1c492 100644
--- a/frontend-modern/src/components/shared/__tests__/historyChartModel.branchcov2.test.ts
+++ b/frontend-modern/src/components/shared/__tests__/historyChartModel.branchcov2.test.ts
@@ -496,7 +496,7 @@ describe('getHistoryChartTooltipLayout', () => {
chartHeight: 180,
});
- expect(layout).toStrictEqual({ x: 162, y: 47, width: 156, height: 46 });
+ expect(layout).toStrictEqual({ x: 162, y: 38, width: 156, height: 64 });
});
it('places the tooltip to the left when only the left side has room', () => {
@@ -537,7 +537,7 @@ describe('getHistoryChartTooltipLayout', () => {
chartHeight: 180,
});
- expect(layout).toStrictEqual({ x: 12, y: 12, width: 156, height: 46 });
+ expect(layout).toStrictEqual({ x: 12, y: 82, width: 156, height: 64 });
});
it('pushes an overlapping tooltip above the hovered point when there is headroom above', () => {
@@ -558,6 +558,6 @@ describe('getHistoryChartTooltipLayout', () => {
chartHeight: 180,
});
- expect(layout.y).toBe(126);
+ expect(layout.y + layout.height).toBe(172);
});
});