Skip to content

Commit

Permalink
chore(fe): upgrade @testing-library packages (jest-dom, react-hooks) …
Browse files Browse the repository at this point in the history
…to latest version + upgrade @testing-library/user-event to v13

Signed-off-by: hainenber <[email protected]>
  • Loading branch information
hainenber committed Sep 21, 2024
1 parent 68d2f8e commit 0ecf936
Show file tree
Hide file tree
Showing 17 changed files with 187 additions and 186 deletions.
320 changes: 161 additions & 159 deletions superset-frontend/package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions superset-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,10 @@
"@storybook/react-webpack5": "8.1.11",
"@svgr/webpack": "^8.1.0",
"@testing-library/dom": "^8.20.1",
"@testing-library/jest-dom": "^5.11.6",
"@testing-library/jest-dom": "^6.5.0",
"@testing-library/react": "^12.1.5",
"@testing-library/react-hooks": "^5.1.3",
"@testing-library/user-event": "^12.7.0",
"@testing-library/react-hooks": "^8.0.1",
"@testing-library/user-event": "^13.5.0",
"@types/classnames": "^2.2.10",
"@types/dom-to-image": "^2.6.7",
"@types/enzyme": "^3.10.18",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
"@emotion/react": "^11.4.1",
"@superset-ui/core": "*",
"@testing-library/dom": "^8.20.1",
"@testing-library/jest-dom": "^5.11.6",
"@testing-library/jest-dom": "*",
"@testing-library/react": "^12.1.5",
"@testing-library/react-hooks": "^5.0.3",
"@testing-library/user-event": "^12.7.0",
"@testing-library/react-hooks": "*",
"@testing-library/user-event": "*",
"ace-builds": "^1.4.14",
"antd": "4.10.3",
"brace": "^0.11.1",
Expand Down
6 changes: 3 additions & 3 deletions superset-frontend/packages/superset-ui-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
],
"dependencies": {
"@babel/runtime": "^7.25.6",
"@testing-library/react-hooks": "^5.1.3",
"@types/d3-format": "^1.3.0",
"@types/d3-interpolate": "^3.0.4",
"@types/d3-scale": "^2.1.1",
Expand Down Expand Up @@ -75,9 +74,10 @@
"@emotion/react": "^11.4.1",
"@emotion/styled": "^11.3.0",
"@testing-library/dom": "^8.20.1",
"@testing-library/jest-dom": "^5.11.6",
"@testing-library/jest-dom": "*",
"@testing-library/react": "^12.1.5",
"@testing-library/user-event": "^12.7.0",
"@testing-library/react-hooks": "*",
"@testing-library/user-event": "*",
"@types/react": "*",
"@types/react-loadable": "*",
"@types/tinycolor2": "*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"peerDependencies": {
"@superset-ui/chart-controls": "*",
"@superset-ui/core": "*",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/jest-dom": "*",
"@testing-library/react": "^12.1.5",
"react": "^16.13.1",
"react-dom": "^16.13.1"
Expand Down
6 changes: 3 additions & 3 deletions superset-frontend/plugins/plugin-chart-table/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
"@superset-ui/chart-controls": "*",
"@superset-ui/core": "*",
"@testing-library/dom": "^8.20.1",
"@testing-library/jest-dom": "^5.11.6",
"@testing-library/jest-dom": "*",
"@testing-library/react": "^12.1.5",
"@testing-library/react-hooks": "^5.0.3",
"@testing-library/user-event": "^12.7.0",
"@testing-library/react-hooks": "*",
"@testing-library/user-event": "*",
"@types/classnames": "*",
"@types/react": "*",
"match-sorter": "^6.3.3",
Expand Down
2 changes: 1 addition & 1 deletion superset-frontend/spec/helpers/testing-library.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import '@testing-library/jest-dom/extend-expect';
import '@testing-library/jest-dom';
import { ReactNode, ReactElement } from 'react';
import {
render,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import * as uiCore from '@superset-ui/core';
import { Provider } from 'react-redux';
import { supersetTheme, ThemeProvider } from '@superset-ui/core';
import { render, screen, act } from '@testing-library/react';
import '@testing-library/jest-dom/extend-expect';
import '@testing-library/jest-dom';
import userEvent from '@testing-library/user-event';
import * as utils from 'src/utils/common';
import ShareSqlLabQuery from 'src/SqlLab/components/ShareSqlLabQuery';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
import { render } from 'spec/helpers/testing-library';
import SouthPane from 'src/SqlLab/components/SouthPane';
import '@testing-library/jest-dom/extend-expect';
import '@testing-library/jest-dom';
import { STATUS_OPTIONS } from 'src/SqlLab/constants';
import { initialState, table, defaultQueryEditor } from 'src/SqlLab/fixtures';
import { denormalizeTimestamp } from '@superset-ui/core';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import '@testing-library/jest-dom/extend-expect';
import '@testing-library/jest-dom';
import { render, screen } from 'spec/helpers/testing-library';
import userEvent from '@testing-library/user-event';
import AlteredSliceTag, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
* under the License.
*/

import '@testing-library/jest-dom';
import { render, screen, fireEvent } from '@testing-library/react';
import '@testing-library/jest-dom/extend-expect';
import {
ErrorLevel,
ErrorTypeEnum,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/
import { Preset } from '@superset-ui/core';
import userEvent, { specialChars } from '@testing-library/user-event';
import userEvent from '@testing-library/user-event';
import fetchMock from 'fetch-mock';
import chartQueries from 'spec/fixtures/mockChartQueries';
import { dashboardLayout } from 'spec/fixtures/mockDashboardLayout';
Expand Down Expand Up @@ -287,7 +287,7 @@ test('validates the column', async () => {
test.skip('validates the default value', async () => {
defaultRender(noTemporalColumnsState());
expect(await screen.findByText('birth_names')).toBeInTheDocument();
userEvent.type(screen.getByRole('combobox'), `Column A${specialChars.enter}`);
userEvent.type(screen.getByRole('combobox'), `Column A{Enter}`);
userEvent.click(getCheckbox(DEFAULT_VALUE_REGEX));
await waitFor(() => {
expect(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/
import { render } from '@testing-library/react';
import '@testing-library/jest-dom/extend-expect'; // For advanced DOM assertions
import '@testing-library/jest-dom'; // For advanced DOM assertions
import { CurrentCalendarFrame } from '../components/CurrentCalendarFrame';
import { CurrentWeek } from '../types';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import { render, fireEvent } from '@testing-library/react';
import '@testing-library/jest-dom/extend-expect';
import '@testing-library/jest-dom';
import { Provider } from 'react-redux';
import configureMockStore from 'redux-mock-store';
import thunk from 'redux-thunk';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import { render, fireEvent } from '@testing-library/react';
import '@testing-library/jest-dom/extend-expect';
import '@testing-library/jest-dom';
import { ThemeProvider, supersetTheme } from '@superset-ui/core';
import { DatabaseObject } from 'src/features/databases/types';
import { OAuth2ClientField } from './OAuth2ClientField';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ test('CSV, form post', async () => {
const inputElement = document.querySelector('input[type="file"]');

if (inputElement) {
userEvent.upload(inputElement, file);
userEvent.upload(inputElement as HTMLElement, file);
}

const selectDatabase = screen.getByRole('combobox', {
Expand Down Expand Up @@ -673,7 +673,7 @@ test('Excel, form post', async () => {
const inputElement = document.querySelector('input[type="file"]');

if (inputElement) {
userEvent.upload(inputElement, file);
userEvent.upload(inputElement as HTMLElement, file);
}

const selectDatabase = screen.getByRole('combobox', {
Expand Down Expand Up @@ -734,7 +734,7 @@ test('Columnar, form post', async () => {
const inputElement = document.querySelector('input[type="file"]');

if (inputElement) {
userEvent.upload(inputElement, file);
userEvent.upload(inputElement as HTMLElement, file);
}

const selectDatabase = screen.getByRole('combobox', {
Expand Down
1 change: 0 additions & 1 deletion superset-websocket/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
},
"license": "Apache-2.0",
"dependencies": {
"@types/lodash": "^4.17.7",
"cookie": "^0.6.0",
"hot-shots": "^10.0.0",
"ioredis": "^4.28.0",
Expand Down

0 comments on commit 0ecf936

Please sign in to comment.