mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: adjust more unit tests to work with react 18 (#64759)
adjust unit tests to work with react 18
This commit is contained in:
@@ -465,17 +465,17 @@ describe('Plugin details page', () => {
|
||||
|
||||
// Does not show an Install button
|
||||
rendered = renderPluginDetails({ id }, { pluginsStateOverride });
|
||||
expect(await rendered.queryByRole('button', { name: /(un)?install/i })).not.toBeInTheDocument();
|
||||
expect(rendered.queryByRole('button', { name: /(un)?install/i })).not.toBeInTheDocument();
|
||||
rendered.unmount();
|
||||
|
||||
// Does not show a Uninstall button
|
||||
rendered = renderPluginDetails({ id, isInstalled: true }, { pluginsStateOverride });
|
||||
expect(await rendered.queryByRole('button', { name: /(un)?install/i })).not.toBeInTheDocument();
|
||||
expect(rendered.queryByRole('button', { name: /(un)?install/i })).not.toBeInTheDocument();
|
||||
rendered.unmount();
|
||||
|
||||
// Does not show an Update button
|
||||
rendered = renderPluginDetails({ id, isInstalled: true, hasUpdate: true }, { pluginsStateOverride });
|
||||
expect(await rendered.queryByRole('button', { name: /update/i })).not.toBeInTheDocument();
|
||||
expect(rendered.queryByRole('button', { name: /update/i })).not.toBeInTheDocument();
|
||||
|
||||
// Shows a message to the user
|
||||
// TODO<Import these texts from a single source of truth instead of having them defined in multiple places>
|
||||
@@ -491,15 +491,17 @@ describe('Plugin details page', () => {
|
||||
|
||||
// Should not show an "Install" button
|
||||
rendered = renderPluginDetails({ id, isInstalled: false });
|
||||
expect(await rendered.queryByRole('button', { name: /^install/i })).not.toBeInTheDocument();
|
||||
expect(rendered.queryByRole('button', { name: /^install/i })).not.toBeInTheDocument();
|
||||
rendered.unmount();
|
||||
|
||||
// Should not show an "Uninstall" button
|
||||
rendered = renderPluginDetails({ id, isInstalled: true });
|
||||
expect(await rendered.queryByRole('button', { name: /^uninstall/i })).not.toBeInTheDocument();
|
||||
expect(rendered.queryByRole('button', { name: /^uninstall/i })).not.toBeInTheDocument();
|
||||
rendered.unmount();
|
||||
|
||||
// Should not show an "Update" button
|
||||
rendered = renderPluginDetails({ id, isInstalled: true, hasUpdate: true });
|
||||
expect(await rendered.queryByRole('button', { name: /^update/i })).not.toBeInTheDocument();
|
||||
expect(rendered.queryByRole('button', { name: /^update/i })).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('should display a "Create" button as a post installation step for installed data source plugins', async () => {
|
||||
|
||||
Reference in New Issue
Block a user