mirror of
https://github.com/apache/superset.git
synced 2026-05-07 17:04:58 +00:00
test(frontend): Migrate from describe/it to flat test() pattern (#35305)
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -64,6 +64,7 @@ const defaultProps = {
|
||||
},
|
||||
};
|
||||
|
||||
// eslint-disable-next-line no-restricted-globals -- TODO: Migrate from describe blocks
|
||||
describe('DatasourceControl', () => {
|
||||
const setup = (overrideProps = {}) => {
|
||||
const mockStore = configureStore([]);
|
||||
@@ -83,17 +84,17 @@ describe('DatasourceControl', () => {
|
||||
};
|
||||
};
|
||||
|
||||
it('should not render Modal', () => {
|
||||
test('should not render Modal', () => {
|
||||
setup();
|
||||
expect(screen.queryByRole('dialog')).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('should not render ChangeDatasourceModal', () => {
|
||||
test('should not render ChangeDatasourceModal', () => {
|
||||
setup();
|
||||
expect(screen.queryByTestId('Swap dataset-modal')).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('show or hide Edit Datasource option', async () => {
|
||||
test('show or hide Edit Datasource option', async () => {
|
||||
const {
|
||||
rendered: { container, rerender },
|
||||
store,
|
||||
@@ -127,7 +128,7 @@ describe('DatasourceControl', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('should render health check message', async () => {
|
||||
test('should render health check message', async () => {
|
||||
setup();
|
||||
const modalTrigger = screen.getByLabelText('warning');
|
||||
expect(modalTrigger).toBeInTheDocument();
|
||||
@@ -141,7 +142,7 @@ describe('DatasourceControl', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('Gets Datasource Title', () => {
|
||||
test('Gets Datasource Title', () => {
|
||||
const sql = 'This is the sql';
|
||||
const name = 'this is a name';
|
||||
const emptyResult = '';
|
||||
|
||||
Reference in New Issue
Block a user