Align History regressions with wrapped tooltips and empty announcements

Retain exact geometry controls for the taller tooltip and assert empty announcement text rather than absence of Solid's empty text node.

Contract-Neutral: Test-only expectations for the existing keyboard inspection and tooltip repair; no runtime or interface change.
Change-source: pulse-maintainer
This commit is contained in:
pulse-triage[bot] 2026-10-02 16:06:13 +01:00
parent 6ec5efe0f8
commit 65a36dd4e7
2 changed files with 8 additions and 8 deletions

View file

@ -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', () => {

View file

@ -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);
});
});