chore(deps-dev): bump eslint-plugin-jest-dom from 3.6.5 to 5.5.0 in /superset-frontend (#31217)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Joe Li <joe@preset.io>
This commit is contained in:
dependabot[bot]
2024-12-20 14:45:07 -07:00
committed by GitHub
parent a275a86d12
commit ddd964e49a
21 changed files with 114 additions and 229 deletions

View File

@@ -57,7 +57,7 @@ describe('EstimateQueryCostButton', () => {
it('renders EstimateQueryCostButton', async () => {
const { queryByText } = setup({}, mockStore(initialState));
expect(queryByText('Estimate cost')).toBeTruthy();
expect(queryByText('Estimate cost')).toBeInTheDocument();
});
it('renders label for selected query', async () => {
@@ -66,7 +66,7 @@ describe('EstimateQueryCostButton', () => {
mockStore(initialState),
);
expect(queryByText('Estimate selected query cost')).toBeTruthy();
expect(queryByText('Estimate selected query cost')).toBeInTheDocument();
});
it('renders label for selected query from unsaved', async () => {
@@ -84,7 +84,7 @@ describe('EstimateQueryCostButton', () => {
}),
);
expect(queryByText('Estimate selected query cost')).toBeTruthy();
expect(queryByText('Estimate selected query cost')).toBeInTheDocument();
});
it('renders estimation error result', async () => {
@@ -103,10 +103,10 @@ describe('EstimateQueryCostButton', () => {
}),
);
expect(queryByText('Estimate cost')).toBeTruthy();
expect(queryByText('Estimate cost')).toBeInTheDocument();
fireEvent.click(getByText('Estimate cost'));
expect(queryByText('Estimate error')).toBeTruthy();
expect(queryByText('Estimate error')).toBeInTheDocument();
});
it('renders estimation success result', async () => {
@@ -126,9 +126,9 @@ describe('EstimateQueryCostButton', () => {
}),
);
expect(queryByText('Estimate cost')).toBeTruthy();
expect(queryByText('Estimate cost')).toBeInTheDocument();
fireEvent.click(getByText('Estimate cost'));
expect(queryByText('Total cost')).toBeTruthy();
expect(queryByText('Total cost')).toBeInTheDocument();
});
});

View File

@@ -54,7 +54,7 @@ describe('ExploreCtasResultsButton', () => {
it('renders', async () => {
const { queryByText } = setup({}, mockStore(initialState));
expect(queryByText('Explore')).toBeTruthy();
expect(queryByText('Explore')).toBeInTheDocument();
});
it('visualize results', async () => {

View File

@@ -37,14 +37,14 @@ describe('ExploreResultsButton', () => {
database: { allows_subquery: true },
});
expect(queryByText('Create Chart')).toBeTruthy();
expect(queryByText('Create Chart')).toBeInTheDocument();
expect(screen.getByRole('button', { name: 'Create Chart' })).toBeEnabled();
});
it('renders disabled if subquery not allowed', async () => {
const { queryByText } = setup(jest.fn());
expect(queryByText('Create Chart')).toBeTruthy();
expect(queryByText('Create Chart')).toBeInTheDocument();
expect(screen.getByRole('button', { name: 'Create Chart' })).toBeDisabled();
});
});

View File

@@ -400,7 +400,7 @@ describe('ResultSet', () => {
name: /fetch data preview/i,
}),
).toBeVisible();
expect(screen.queryByRole('table')).toBe(null);
expect(screen.queryByRole('table')).not.toBeInTheDocument();
});
test('Async queries - renders "Refetch results" button when a query has no results', () => {
@@ -429,7 +429,7 @@ describe('ResultSet', () => {
name: /refetch results/i,
}),
).toBeVisible();
expect(screen.queryByRole('table')).toBe(null);
expect(screen.queryByRole('table')).not.toBeInTheDocument();
});
test('Async queries - renders on the first call', () => {
@@ -454,12 +454,12 @@ describe('ResultSet', () => {
screen.queryByRole('button', {
name: /fetch data preview/i,
}),
).toBe(null);
).not.toBeInTheDocument();
expect(
screen.queryByRole('button', {
name: /refetch results/i,
}),
).toBe(null);
).not.toBeInTheDocument();
});
test('should allow download as CSV when user has permission to export data', async () => {

View File

@@ -59,9 +59,9 @@ const setup = (queryEditor: QueryEditor, store?: Store) =>
describe('SqlEditorTabHeader', () => {
it('renders name', () => {
const { queryByText } = setup(defaultQueryEditor, mockStore(initialState));
expect(queryByText(defaultQueryEditor.name)).toBeTruthy();
expect(queryByText(extraQueryEditor1.name)).toBeFalsy();
expect(queryByText(extraQueryEditor2.name)).toBeFalsy();
expect(queryByText(defaultQueryEditor.name)).toBeInTheDocument();
expect(queryByText(extraQueryEditor1.name)).not.toBeInTheDocument();
expect(queryByText(extraQueryEditor2.name)).not.toBeInTheDocument();
});
it('renders name from unsaved changes', () => {
@@ -79,10 +79,10 @@ describe('SqlEditorTabHeader', () => {
},
}),
);
expect(queryByText(expectedTitle)).toBeTruthy();
expect(queryByText(defaultQueryEditor.name)).toBeFalsy();
expect(queryByText(extraQueryEditor1.name)).toBeFalsy();
expect(queryByText(extraQueryEditor2.name)).toBeFalsy();
expect(queryByText(expectedTitle)).toBeInTheDocument();
expect(queryByText(defaultQueryEditor.name)).not.toBeInTheDocument();
expect(queryByText(extraQueryEditor1.name)).not.toBeInTheDocument();
expect(queryByText(extraQueryEditor2.name)).not.toBeInTheDocument();
});
it('renders current name for unrelated unsaved changes', () => {
@@ -100,10 +100,10 @@ describe('SqlEditorTabHeader', () => {
},
}),
);
expect(queryByText(defaultQueryEditor.name)).toBeTruthy();
expect(queryByText(unrelatedTitle)).toBeFalsy();
expect(queryByText(extraQueryEditor1.name)).toBeFalsy();
expect(queryByText(extraQueryEditor2.name)).toBeFalsy();
expect(queryByText(defaultQueryEditor.name)).toBeInTheDocument();
expect(queryByText(unrelatedTitle)).not.toBeInTheDocument();
expect(queryByText(extraQueryEditor1.name)).not.toBeInTheDocument();
expect(queryByText(extraQueryEditor2.name)).not.toBeInTheDocument();
});
describe('with dropdown menus', () => {

View File

@@ -118,7 +118,9 @@ test('should removeQueryEditor', async () => {
fireEvent.click(closeButton);
}
await waitFor(() => expect(getAllByRole('tab').length).toEqual(tabCount - 1));
expect(queryByText(initialState.sqlLab.queryEditors[0].name)).toBeFalsy();
expect(
queryByText(initialState.sqlLab.queryEditors[0].name),
).not.toBeInTheDocument();
});
test('should add new query editor', async () => {
const { getAllByLabelText, getAllByRole } = setup(undefined, initialState);