Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
legacy-peer-deps=true
engine-strict=true
save-exact = true
engine-strict = true
legacy-peer-deps = true
prefer-dedupe = true
lockfile-version = 3
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.18.0
v20.19.1
2 changes: 1 addition & 1 deletion bin/docker-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ cli wp option set woocommerce_allow_tracking "no"
cli wp option set woocommerce_coming_soon "no"

echo "Importing WooCommerce shop pages..."
cli wp --user=admin wc tool run install_pages
cli wp wc --user=admin tool run install_pages

echo "Installing and activating the WordPress Importer plugin..."
cli wp plugin install wordpress-importer --activate
Expand Down
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*** Changelog ***

= 9.10.0 - xxxx-xx-xx =
* Dev - Upgrades Node to v20
* Dev - Fix live reload issue with Webpack 5
* Add - Adds support for the Romanian Leu (RON) currency when paying with Klarna
* Update - Reduces the minimum transaction amount for Affirm to 35 USD
Expand Down
25 changes: 10 additions & 15 deletions client/stripe-utils/__tests__/cash-app-limit-notice-handler.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,57 +7,54 @@ const wrapperElementClassName = 'woocommerce-checkout-payment';

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

const elementLoadingDelay = 500;

callWhenElementIsAvailable.mockImplementation(
( selector, callable, params ) => {
setTimeout( () => {
callable( ...params );
}, elementLoadingDelay );
callable( ...params );
}
);

jest.useFakeTimers();

describe( 'cash-app-limit-notice-handler', () => {
it( 'does not render notice, cart amount is below threshold, wrapper not found and it is not a block checkout', () => {
maybeShowCashAppLimitNotice(
'.woocommerce-checkout-payment',
0,
false
);

expect(
screen.queryByTestId( 'cash-app-limit-notice' )
).not.toBeInTheDocument();
} );

it( 'does not render notice, cart amount is below threshold, but try to wait for wrapper to exist (block checkout)', () => {
render( <div data-block-name="woocommerce/checkout" /> );

maybeShowCashAppLimitNotice( '.woocommerce-checkout-payment', 0, true );

expect(
screen.queryByTestId( 'cash-app-limit-notice' )
).not.toBeInTheDocument();
} );

it( 'render notice immediately (not block checkout, cart amount above threshold)', () => {
render( <div className={ wrapperElementClassName } /> );

maybeShowCashAppLimitNotice(
'.woocommerce-checkout-payment',
CASH_APP_NOTICE_AMOUNT_THRESHOLD + 1,
false
);

expect(
screen.queryByTestId( 'cash-app-limit-notice' )
).toBeInTheDocument();
} );

it( 'render notice after wrapper exists on block checkout (cart amount above threshold)', () => {
it( 'render notice after wrapper exists on block checkout (cart amount above threshold)', async () => {
function App() {
setTimeout( () => {
const wrapper = document.createElement( 'div' );
wrapper.classList.add( wrapperElementClassName );
document.body.appendChild( wrapper );
}, elementLoadingDelay - 100 );
const wrapper = document.createElement( 'div' );
wrapper.classList.add( wrapperElementClassName );
document.body.appendChild( wrapper );
return <div data-block-name="woocommerce/checkout" />;
}

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

jest.runAllTimers();

expect(
screen.queryByTestId( 'cash-app-limit-notice' )
).toBeInTheDocument();
Expand Down
Loading
Loading