@@ -20,7 +20,7 @@ jest.mock( 'wcstripe/data/account-keys/hooks', () => ( {
20
20
} ) ) ;
21
21
22
22
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 ( ) => {
24
24
const setTestModeMock = jest . fn ( ) ;
25
25
useTestMode . mockReturnValue ( [ false , setTestModeMock ] ) ;
26
26
useAccountKeys . mockReturnValue ( {
@@ -36,12 +36,12 @@ describe( 'TestModeCheckbox', () => {
36
36
const testModeCheckbox = screen . getByLabelText ( 'Enable test mode' ) ;
37
37
expect ( testModeCheckbox ) . not . toBeChecked ( ) ;
38
38
39
- userEvent . click ( testModeCheckbox ) ;
39
+ await userEvent . click ( testModeCheckbox ) ;
40
40
41
41
expect ( setTestModeMock ) . toHaveBeenCalledWith ( true ) ;
42
42
} ) ;
43
43
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 ( ) => {
45
45
const setTestModeMock = jest . fn ( ) ;
46
46
useTestMode . mockReturnValue ( [ true , setTestModeMock ] ) ;
47
47
useAccountKeys . mockReturnValue ( {
@@ -57,7 +57,7 @@ describe( 'TestModeCheckbox', () => {
57
57
const testModeCheckbox = screen . getByLabelText ( 'Enable test mode' ) ;
58
58
expect ( testModeCheckbox ) . toBeChecked ( ) ;
59
59
60
- userEvent . click ( testModeCheckbox ) ;
60
+ await userEvent . click ( testModeCheckbox ) ;
61
61
62
62
expect ( setTestModeMock ) . toHaveBeenCalledWith ( false ) ;
63
63
} ) ;
0 commit comments