diff --git a/.betterer.results b/.betterer.results index eb57573c522..27eaf34ea5c 100644 --- a/.betterer.results +++ b/.betterer.results @@ -122,9 +122,6 @@ exports[`no enzyme tests`] = { "public/app/features/datasources/DataSourcesListPage.test.tsx:2960099202": [ [0, 19, 13, "RegExp match", "2409514259"] ], - "public/app/features/datasources/settings/ButtonRow.test.tsx:1422996720": [ - [0, 19, 13, "RegExp match", "2409514259"] - ], "public/app/features/dimensions/editors/ThresholdsEditor/ThresholdsEditor.test.tsx:4164297658": [ [0, 17, 13, "RegExp match", "2409514259"] ], diff --git a/public/app/features/datasources/settings/ButtonRow.test.tsx b/public/app/features/datasources/settings/ButtonRow.test.tsx index 9508cfd8e97..0fdc4163fb9 100644 --- a/public/app/features/datasources/settings/ButtonRow.test.tsx +++ b/public/app/features/datasources/settings/ButtonRow.test.tsx @@ -1,6 +1,8 @@ -import { shallow } from 'enzyme'; +import { screen, render } from '@testing-library/react'; import React from 'react'; +import { selectors } from '@grafana/e2e-selectors'; + import ButtonRow, { Props } from './ButtonRow'; jest.mock('app/core/core', () => { @@ -23,22 +25,18 @@ const setup = (propOverrides?: object) => { Object.assign(props, propOverrides); - return shallow(); + return render(); }; -describe('Render', () => { +describe('Button Row', () => { it('should render component', () => { - const wrapper = setup(); + setup(); - expect(wrapper).toMatchSnapshot(); + expect(screen.getByRole('button', { name: selectors.pages.DataSource.delete })).toBeInTheDocument(); }); + it('should render save & test', () => { + setup({ canSave: true }); - it('should render with buttons enabled', () => { - const wrapper = setup({ - canSave: true, - canDelete: true, - }); - - expect(wrapper).toMatchSnapshot(); + expect(screen.getByRole('button', { name: selectors.pages.DataSource.saveAndTest })).toBeInTheDocument(); }); }); diff --git a/public/app/features/datasources/settings/__snapshots__/ButtonRow.test.tsx.snap b/public/app/features/datasources/settings/__snapshots__/ButtonRow.test.tsx.snap deleted file mode 100644 index dad29a6f8e8..00000000000 --- a/public/app/features/datasources/settings/__snapshots__/ButtonRow.test.tsx.snap +++ /dev/null @@ -1,81 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Render should render component 1`] = ` -
- - - Explore - - - -
-`; - -exports[`Render should render with buttons enabled 1`] = ` -
- - - Explore - - - -
-`;