Files
grafana/public/app/features/datasources/components/BasicSettings.test.tsx
Esteban Beltran 46142da4db Chore: Migrate from aria-label to data-testid in plugin-related tests (#79272)
* Update basicsettings for datasource

* Change aria-label for data-testid

* Update more tests

* Update betterer

* Remove unnecessary data-testid

* Put back aria label for some datasource selectors

* Try to use data-testid with alerts

* Update betterer
2023-12-11 15:05:54 +01:00

27 lines
682 B
TypeScript

import { render, screen } from '@testing-library/react';
import React from 'react';
import { selectors } from '@grafana/e2e-selectors';
import { BasicSettings, Props } from './BasicSettings';
const setup = () => {
const props: Props = {
dataSourceName: 'Graphite',
isDefault: false,
onDefaultChange: jest.fn(),
onNameChange: jest.fn(),
};
return render(<BasicSettings {...props} />);
};
describe('<BasicSettings>', () => {
it('should render component', () => {
setup();
expect(screen.getByTestId(selectors.pages.DataSource.name)).toBeInTheDocument();
expect(screen.getByRole('checkbox', { name: /Default/ })).toBeInTheDocument();
});
});