Skip to content

Commit 929b449

Browse files
authored
Upgrading node to v20 (#4670)
* Upgrading node to v20 * Changelog and readme entries * Removing unnecessary package * Revert unnecessary changes * Adding packages to fix tests * Putting the live reload package back * Revert unnecessary change * Updating Node version in .nvmrc * Changing Node version to 20.11.1 to match dependency-extraction-webpack-plugin min supported version * Upgrading node version to match cheerio requirement * Reverting unrelated changes * Fix indentation
1 parent ff43d92 commit 929b449

File tree

9 files changed

+12405
-39829
lines changed

9 files changed

+12405
-39829
lines changed

.npmrc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1-
legacy-peer-deps=true
2-
engine-strict=true
1+
save-exact = true
2+
engine-strict = true
3+
legacy-peer-deps = true
4+
prefer-dedupe = true
5+
lockfile-version = 3

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
16.18.0
1+
v20.18.1

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.10.0 - xxxx-xx-xx =
4+
* Dev - Upgrades Node to v20
45
* Add - Allow the purchase of free trials using the Express Payment methods when the product does not require shipping
56
* Update - Changes the documentation page URL for the Optimized Checkout feature to https://woocommerce.com/document/stripe/admin-experience/optimized-checkout-suite/
67
* Update - Changes the background color and spacing for the Woo logo shown in the account modal

client/stripe-utils/__tests__/cash-app-limit-notice-handler.test.js

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,57 +7,54 @@ const wrapperElementClassName = 'woocommerce-checkout-payment';
77

88
jest.mock( 'wcstripe/blocks/upe/call-when-element-is-available' );
99

10-
const elementLoadingDelay = 500;
11-
1210
callWhenElementIsAvailable.mockImplementation(
1311
( selector, callable, params ) => {
14-
setTimeout( () => {
15-
callable( ...params );
16-
}, elementLoadingDelay );
12+
callable( ...params );
1713
}
1814
);
1915

20-
jest.useFakeTimers();
21-
2216
describe( 'cash-app-limit-notice-handler', () => {
2317
it( 'does not render notice, cart amount is below threshold, wrapper not found and it is not a block checkout', () => {
2418
maybeShowCashAppLimitNotice(
2519
'.woocommerce-checkout-payment',
2620
0,
2721
false
2822
);
23+
2924
expect(
3025
screen.queryByTestId( 'cash-app-limit-notice' )
3126
).not.toBeInTheDocument();
3227
} );
3328

3429
it( 'does not render notice, cart amount is below threshold, but try to wait for wrapper to exist (block checkout)', () => {
3530
render( <div data-block-name="woocommerce/checkout" /> );
31+
3632
maybeShowCashAppLimitNotice( '.woocommerce-checkout-payment', 0, true );
33+
3734
expect(
3835
screen.queryByTestId( 'cash-app-limit-notice' )
3936
).not.toBeInTheDocument();
4037
} );
4138

4239
it( 'render notice immediately (not block checkout, cart amount above threshold)', () => {
4340
render( <div className={ wrapperElementClassName } /> );
41+
4442
maybeShowCashAppLimitNotice(
4543
'.woocommerce-checkout-payment',
4644
CASH_APP_NOTICE_AMOUNT_THRESHOLD + 1,
4745
false
4846
);
47+
4948
expect(
5049
screen.queryByTestId( 'cash-app-limit-notice' )
5150
).toBeInTheDocument();
5251
} );
5352

54-
it( 'render notice after wrapper exists on block checkout (cart amount above threshold)', () => {
53+
it( 'render notice after wrapper exists on block checkout (cart amount above threshold)', async () => {
5554
function App() {
56-
setTimeout( () => {
57-
const wrapper = document.createElement( 'div' );
58-
wrapper.classList.add( wrapperElementClassName );
59-
document.body.appendChild( wrapper );
60-
}, elementLoadingDelay - 100 );
55+
const wrapper = document.createElement( 'div' );
56+
wrapper.classList.add( wrapperElementClassName );
57+
document.body.appendChild( wrapper );
6158
return <div data-block-name="woocommerce/checkout" />;
6259
}
6360

@@ -69,8 +66,6 @@ describe( 'cash-app-limit-notice-handler', () => {
6966
true
7067
);
7168

72-
jest.runAllTimers();
73-
7469
expect(
7570
screen.queryByTestId( 'cash-app-limit-notice' )
7671
).toBeInTheDocument();

0 commit comments

Comments
 (0)