Kaynağa Gözat

refactor(test): add timer cleanup in SignUpForm test

satnaing 2 ay önce
ebeveyn
işleme
457ea06c62

+ 5 - 1
src/features/auth/sign-up/components/sign-up-form.test.tsx

@@ -1,4 +1,4 @@
-import { beforeEach, describe, expect, it, vi } from 'vitest'
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
 import { render, type RenderResult } from 'vitest-browser-react'
 import { type Locator, userEvent } from 'vitest/browser'
 import { SignUpForm } from './sign-up-form'
@@ -35,6 +35,10 @@ describe('SignUpForm', () => {
     submitButton = screen.getByRole('button', { name: /^Create Account$/i })
   })
 
+  afterEach(() => {
+    vi.useRealTimers()
+  })
+
   it('renders fields and submit button', async () => {
     expect(emailInput).toBeInTheDocument()
     expect(passwordInput).toBeInTheDocument()