1 parent 81fbe50 commit 8c4adecCopy full SHA for 8c4adec
1 file changed
packages/emcn/src/components/input-otp/input-otp.test.tsx
@@ -10,6 +10,7 @@ let root: Root
10
let host: HTMLDivElement
11
12
beforeEach(() => {
13
+ vi.useFakeTimers()
14
;(globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }).IS_REACT_ACT_ENVIRONMENT = true
15
vi.stubGlobal(
16
'ResizeObserver',
@@ -25,9 +26,12 @@ beforeEach(() => {
25
26
})
27
28
afterEach(() => {
- act(() => root.unmount())
29
+ act(() => {
30
+ root.unmount()
31
+ vi.runOnlyPendingTimers()
32
+ })
33
host.remove()
- vi.unstubAllGlobals()
34
+ vi.useRealTimers()
35
36
37
function renderOtp(invalid: boolean) {
0 commit comments