Skip to content

Commit 2d3dbcf

Browse files
daledupreezwjrosa
authored andcommitted
Fix TestModeCheckbox tests
1 parent 4a67704 commit 2d3dbcf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

client/settings/payment-settings/__tests__/test-mode-checkbox.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jest.mock( 'wcstripe/data/account-keys/hooks', () => ( {
2020
} ) );
2121

2222
describe( 'TestModeCheckbox', () => {
23-
it( 'should enable test mode when the test account keys are present', () => {
23+
it( 'should enable test mode when the test account keys are present', async () => {
2424
const setTestModeMock = jest.fn();
2525
useTestMode.mockReturnValue( [ false, setTestModeMock ] );
2626
useAccountKeys.mockReturnValue( {
@@ -36,12 +36,12 @@ describe( 'TestModeCheckbox', () => {
3636
const testModeCheckbox = screen.getByLabelText( 'Enable test mode' );
3737
expect( testModeCheckbox ).not.toBeChecked();
3838

39-
userEvent.click( testModeCheckbox );
39+
await userEvent.click( testModeCheckbox );
4040

4141
expect( setTestModeMock ).toHaveBeenCalledWith( true );
4242
} );
4343

44-
it( 'should enable live mode when the account keys are present', () => {
44+
it( 'should enable live mode when the account keys are present', async () => {
4545
const setTestModeMock = jest.fn();
4646
useTestMode.mockReturnValue( [ true, setTestModeMock ] );
4747
useAccountKeys.mockReturnValue( {
@@ -57,7 +57,7 @@ describe( 'TestModeCheckbox', () => {
5757
const testModeCheckbox = screen.getByLabelText( 'Enable test mode' );
5858
expect( testModeCheckbox ).toBeChecked();
5959

60-
userEvent.click( testModeCheckbox );
60+
await userEvent.click( testModeCheckbox );
6161

6262
expect( setTestModeMock ).toHaveBeenCalledWith( false );
6363
} );

0 commit comments

Comments
 (0)