Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Fix TS error in saved-payment-method-options test
Browse files Browse the repository at this point in the history
  • Loading branch information
opr committed Jun 27, 2023
1 parent cd6f77e commit 5813eea
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ jest.mock( '@wordpress/data', () => ( {
useSelect: jest.fn(),
} ) );

const mockedUseSelect = wpData.useSelect as jest.Mock;
// Mock use select so we can override it when wc/store/checkout is accessed, but return the original select function if any other store is accessed.
wpData.useSelect.mockImplementation(
mockedUseSelect.mockImplementation(
jest.fn().mockImplementation( ( passedMapSelect ) => {
const mockedSelect = jest.fn().mockImplementation( ( storeName ) => {
if ( storeName === 'wc/store/payment' ) {
Expand Down

0 comments on commit 5813eea

Please sign in to comment.