Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v11.0.x] Home dashboard test #87024

Merged
merged 1 commit into from
Apr 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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
Loading