Skip to content

Commit

Permalink
[v11.0.x] Home dashboard test (#87024)
Browse files Browse the repository at this point in the history
Home dashboard test (#86961)

home dashboard test

(cherry picked from commit 8705e03)

Co-authored-by: Victor Marin <36818606+mdvictor@users.noreply.github.com>
  • Loading branch information
grafana-delivery-bot[bot] and mdvictor committed Apr 29, 2024
1 parent 452be5b commit 0e8622e
Showing 1 changed file with 13 additions and 1 deletion.
@@ -1,4 +1,4 @@
import { act, fireEvent, render, screen } from '@testing-library/react';
import { act, fireEvent, render, screen, waitFor } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { cloneDeep } from 'lodash';
import React from 'react';
Expand Down Expand Up @@ -253,6 +253,18 @@ describe('DashboardScenePage', () => {
const editMenuItem = await screen.findAllByText('Edit');
expect(editMenuItem).toHaveLength(1);
});

describe('home page', () => {
it('should not show controls', async () => {
getDashboardScenePageStateManager().clearDashboardCache();
loadDashboardMock.mockClear();
loadDashboardMock.mockResolvedValue({ dashboard: { panels: [] }, meta: {} });

setup();

await waitFor(() => expect(screen.queryByText('Refresh')).not.toBeInTheDocument());
});
});
});

interface VizOptions {
Expand Down

0 comments on commit 0e8622e

Please sign in to comment.