2022-06-18 18:13:51 +08:00
|
|
|
import { render, screen } from '@testing-library/react';
|
2022-04-22 21:33:13 +08:00
|
|
|
|
2022-06-18 18:13:51 +08:00
|
|
|
import { selectors } from '@grafana/e2e-selectors';
|
|
|
|
|
|
2022-07-20 15:25:09 +08:00
|
|
|
import { BasicSettings, Props } from './BasicSettings';
|
2018-11-01 20:45:52 +08:00
|
|
|
|
|
|
|
|
const setup = () => {
|
|
|
|
|
const props: Props = {
|
|
|
|
|
dataSourceName: 'Graphite',
|
2018-12-05 18:47:02 +08:00
|
|
|
isDefault: false,
|
|
|
|
|
onDefaultChange: jest.fn(),
|
|
|
|
|
onNameChange: jest.fn(),
|
2018-11-01 20:45:52 +08:00
|
|
|
};
|
|
|
|
|
|
2022-06-18 18:13:51 +08:00
|
|
|
return render(<BasicSettings {...props} />);
|
2018-11-01 20:45:52 +08:00
|
|
|
};
|
|
|
|
|
|
2022-07-20 15:25:09 +08:00
|
|
|
describe('<BasicSettings>', () => {
|
2018-11-01 20:45:52 +08:00
|
|
|
it('should render component', () => {
|
2022-06-18 18:13:51 +08:00
|
|
|
setup();
|
2018-11-01 20:45:52 +08:00
|
|
|
|
2023-12-11 22:05:54 +08:00
|
|
|
expect(screen.getByTestId(selectors.pages.DataSource.name)).toBeInTheDocument();
|
2024-10-24 18:26:04 +08:00
|
|
|
expect(screen.getByLabelText(/Default/)).toBeInTheDocument();
|
2018-11-01 20:45:52 +08:00
|
|
|
});
|
|
|
|
|
});
|