1
1
import * as React from 'react'
2
2
import { render } from '@saas-ui/test-utils'
3
+ import { vi } from 'vitest'
3
4
4
5
import {
5
6
useHotkeys ,
@@ -36,7 +37,7 @@ const renderModal = (ui: React.ReactNode) => {
36
37
}
37
38
38
39
test ( 'should trigger hotkey shortcuts.' , async ( ) => {
39
- const action = jest . fn ( )
40
+ const action = vi . fn ( )
40
41
const TestComponent = ( ) => {
41
42
const command = useHotkeysShortcut ( 'general.compose' , action )
42
43
@@ -54,7 +55,7 @@ test('should trigger hotkey shortcuts.', async () => {
54
55
} )
55
56
56
57
test ( 'should trigger shifted keys.' , async ( ) => {
57
- const action = jest . fn ( )
58
+ const action = vi . fn ( )
58
59
const TestComponent = ( ) => {
59
60
useHotkeysShortcut ( 'general.help' , action )
60
61
return null
@@ -68,7 +69,7 @@ test('should trigger shifted keys.', async () => {
68
69
} )
69
70
70
71
test ( 'should trigger key combinations.' , async ( ) => {
71
- const action = jest . fn ( )
72
+ const action = vi . fn ( )
72
73
const TestComponent = ( ) => {
73
74
useHotkeysShortcut ( 'general.logout' , action )
74
75
return null
@@ -82,7 +83,7 @@ test('should trigger key combinations.', async () => {
82
83
} )
83
84
84
85
test ( 'should trigger key sequences.' , async ( ) => {
85
- const action = jest . fn ( )
86
+ const action = vi . fn ( )
86
87
const TestComponent = ( ) => {
87
88
useHotkeysShortcut ( 'general.dashboard' , action )
88
89
return null
@@ -97,7 +98,7 @@ test('should trigger key sequences.', async () => {
97
98
} )
98
99
99
100
test ( 'should trigger custom hotkeys.' , async ( ) => {
100
- const action = jest . fn ( )
101
+ const action = vi . fn ( )
101
102
const TestComponent = ( ) => {
102
103
useHotkeys ( 'c' , action )
103
104
return null
@@ -111,7 +112,7 @@ test('should trigger custom hotkeys.', async () => {
111
112
} )
112
113
113
114
test ( 'should support multiple key combinations.' , async ( ) => {
114
- const action = jest . fn ( )
115
+ const action = vi . fn ( )
115
116
const TestComponent = ( ) => {
116
117
useHotkeys ( [ 'c' , 'G then C' ] , action )
117
118
return null
0 commit comments