Merge pull request #11414 from AlexSCorey/upgradeReact

Upgrade react
This commit is contained in:
Sarah Akus 2021-12-09 09:53:35 -05:00 committed by GitHub
commit a259e48377
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 482 additions and 232 deletions

698
awx/ui/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -23,9 +23,9 @@
"js-yaml": "^3.13.1",
"luxon": "^2.0.1",
"prop-types": "^15.6.2",
"react": "^16.13.1",
"react": "17.0.2",
"react-ace": "^9.3.0",
"react-dom": "^16.13.1",
"react-dom": "17.0.2",
"react-error-boundary": "^3.1.3",
"react-router-dom": "^5.1.2",
"react-virtualized": "^9.21.1",
@ -40,6 +40,7 @@
"@lingui/loader": "^3.8.3",
"@lingui/macro": "^3.7.1",
"@nteract/mockument": "^1.0.4",
"@wojtekmaj/enzyme-adapter-react-17": "0.6.5",
"babel-core": "^7.0.0-bridge.0",
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.14.0",

View File

@ -2,6 +2,7 @@ import React from 'react';
import { act } from 'react-dom/test-utils';
import { RootAPI } from 'api';
import * as SessionContext from 'contexts/Session';
import { shallow } from 'enzyme';
import { mountWithContexts } from '../testUtils/enzymeHelpers';
import App, { ProtectedRoute } from './App';
@ -29,7 +30,7 @@ describe('<App />', () => {
let wrapper;
await act(async () => {
wrapper = mountWithContexts(<App />);
wrapper = shallow(<App />);
});
expect(wrapper.length).toBe(1);
jest.clearAllMocks();

View File

@ -1,4 +1,4 @@
import React, { Fragment } from 'react';
import React from 'react';
import { BackgroundImage } from '@patternfly/react-core';

View File

@ -1,6 +1,6 @@
import React from 'react';
import { configure } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
require('@babel/polyfill');

View File

@ -103,7 +103,7 @@ function applyDefaultContexts(context) {
return defaultContexts;
}
const newContext = {};
Object.keys(defaultContexts).forEach(key => {
Object.keys(defaultContexts).forEach((key) => {
newContext[key] = {
...defaultContexts[key],
...context[key],
@ -148,7 +148,7 @@ export function mountWithContexts(node, options = {}) {
export function waitForElement(
wrapper,
selector,
callback = el => el.length === 1
callback = (el) => el.length === 1
) {
const interval = 100;
return new Promise((resolve, reject) => {