Skip to content

Commit fed9917

Browse files
committed
test: change waitFor with act
1 parent 088700e commit fed9917

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/__tests__/pages/PrivatePage.test.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { render, renderHook, screen, waitFor } from '@testing-library/react';
2+
import { act } from 'react-dom/test-utils';
23

34
import api from '@/lib/axios';
45
import { getCookie } from '@/lib/cookie';
@@ -16,7 +17,7 @@ jest.mock('@/lib/cookie', () => ({
1617
describe('PrivatePage', () => {
1718
beforeEach(() => {
1819
const { result } = renderHook(() => useAuthStore());
19-
waitFor(() => result.current.reset());
20+
act(() => result.current.reset());
2021
jest.restoreAllMocks();
2122
});
2223

0 commit comments

Comments
 (0)