Skip to content

Commit 7277bc9

Browse files
wjrosadaledupreezannemirasol
authored
React 18 upgrade + API root creation change (#4617)
* React API root creation change * React dom package updates * Fix tests + React 18 upgrade * Fix tests * Adding react-test-renderer package * Reverting unnecessary changes * Changelog and readme entries * Removing unnecessary package * Updating @testing-library/react * Replace act function source * Fix tests * Remove @testing-library/react-hooks for compatibility with React 18 (#4619) * Use act and renderHook from @testing-library/react instead of @testing-library/react-hooks * Remove @testing-library/react-hooks * Fix warning for PaymentMethodDeprecationPill test (#4620) * Fix merge * Renaming some test files * Fix createRoot console error --------- Co-authored-by: daledupreez <[email protected]> Co-authored-by: Anne Mirasol <[email protected]>
1 parent f06e518 commit 7277bc9

File tree

25 files changed

+1118
-348
lines changed

25 files changed

+1118
-348
lines changed

changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
*** Changelog ***
22

33
= 9.9.0 - xxxx-xx-xx =
4+
* Update - Upgrade React to v18 and related dependencies
45
* Dev - Simplifies the way test payment instructions are built when the Optimized Checkout is enabled
56
* Dev - Upgrades the ESLint packages and their related libraries
67
* Dev - Upgrade the Prettier package and related libraries, and apply updated formatting rules

client/components/payment-method-deprecation-pill/__tests__/payment-method-deprecation-pill.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import UpeToggleContext from 'wcstripe/settings/upe-toggle/context';
66
describe( 'PaymentMethodDeprecationPill', () => {
77
it( 'should render', () => {
88
render(
9-
<UpeToggleContext.Provider>
9+
<UpeToggleContext.Provider value={ true }>
1010
<PaymentMethodDeprecationPill />
1111
</UpeToggleContext.Provider>
1212
);

client/components/popover/test/index.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import { render, screen, act } from '@testing-library/react';
1+
import { render, screen } from '@testing-library/react';
22
import userEvent from '@testing-library/user-event';
3+
import { act } from 'react';
34
import Popover from '..';
45

56
const DummyBaseComponent = ( { children, ...props } ) => (

client/components/tooltip/test/index.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { render, screen, act } from '@testing-library/react';
1+
import { act } from 'react';
2+
import { render, screen } from '@testing-library/react';
23
import userEvent from '@testing-library/user-event';
34
import Tooltip from '..';
45

client/data/account-keys/__tests__/hooks.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { renderHook, act } from '@testing-library/react-hooks';
1+
import { renderHook, act } from '@testing-library/react';
22
import { useAccountKeys, useAccountKeysPublishableKey } from '../hooks';
33
import { STORE_NAME } from '../../constants';
44
import { useSelect, useDispatch } from '@wordpress/data';

client/data/account/__tests__/hooks.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { renderHook } from '@testing-library/react-hooks';
1+
import { renderHook } from '@testing-library/react';
22
import { useGetCapabilities, useAccount } from '../hooks';
33
import { useSelect, useDispatch } from '@wordpress/data';
44

client/data/payment-gateway/__tests__/hooks.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { renderHook, act } from '@testing-library/react-hooks';
1+
import { renderHook, act } from '@testing-library/react';
22
import {
33
usePaymentGateway,
44
useEnabledPaymentGateway,
File renamed without changes.

client/data/settings/__tests__/hooks.js renamed to client/data/settings/__tests__/hooks.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { renderHook, act } from '@testing-library/react-hooks';
1+
import { renderHook, act } from '@testing-library/react';
22
import {
33
useEnabledPaymentMethodIds,
44
useGetAvailablePaymentMethodIds,
File renamed without changes.

0 commit comments

Comments
 (0)