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:
@@ -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
|
||||
});
|
||||
Reference in New Issue
Block a user