test(frontend): Migrate from describe/it to flat test() pattern (#35305)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Evan Rusackas
2025-09-28 11:45:33 -07:00
committed by GitHub
parent ff102aadb3
commit d62249d13f
255 changed files with 2017 additions and 1554 deletions

View File

@@ -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 = '';