Heatmap: Fix runtime error when no data is present, add e2e test (#113242)

* Heatmap: Fix runtime error when no xAxis is present, add e2e test

* update migration test fixture

* updates from review
This commit is contained in:
Paul Marbach
2025-10-31 18:17:30 +00:00
committed by GitHub
parent 2d250ab364
commit 64da716a2e
7 changed files with 231 additions and 58 deletions
@@ -0,0 +1,36 @@
import { test, expect } from '@grafana/plugin-e2e';
const DASHBOARD_UID = '5Y0jv6pVz';
// test.use();
test.describe('Panels test: Heatmap', { tag: ['@panels', '@heatmap'] }, () => {
test('renders successfully', async ({ gotoDashboardPage, selectors, page }) => {
const dashboardPage = await gotoDashboardPage({
uid: DASHBOARD_UID,
});
// check that gauges are rendered
const uplot = page.locator('.uplot');
await expect(uplot, 'panels are rendered').toHaveCount(2);
// check that no panel errors exist
const errorInfo = dashboardPage.getByGrafanaSelector(selectors.components.Panels.Panel.headerCornerInfo('error'));
await expect(errorInfo, 'no errors in the panels').toBeHidden();
});
test('"no data"', async ({ gotoDashboardPage, selectors, page }) => {
const dashboardPage = await gotoDashboardPage({
uid: DASHBOARD_UID,
queryParams: new URLSearchParams({ editPanel: '7' }),
});
const uplot = page.locator('.uplot');
await expect(uplot, "that uplot doesn't appear").toBeHidden();
const emptyMessage = dashboardPage.getByGrafanaSelector(selectors.components.Panels.Panel.PanelDataErrorMessage);
await expect(emptyMessage, 'that the empty text appears').toHaveText('No data');
});
// TODO tooltips, legends, and panel editing
});