Skip to content

Commit

Permalink
fix: lottie-react를 mocking하여 lottie가 렌더링 시 테스트가 실패하지 않도록 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
Todari committed Aug 21, 2024
1 parent 1f0876b commit 91a3336
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions client/src/hooks/useError/useError.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import UnhandledErrorBoundary from '../../UnhandledErrorBoundary';
import {ErrorInfo, ErrorProvider} from './ErrorProvider';
import {useError} from './useError';

jest.mock('lottie-react', () => () => <div>Lottie Mock</div>);

describe('useError', () => {
const initializeProvider = () =>
renderHook(() => useError(), {
Expand Down
2 changes: 2 additions & 0 deletions client/src/hooks/useToast/useToast.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import {ErrorInfo, ErrorProvider} from '../../hooks/useError/ErrorProvider'; //

import {ToastProvider} from './ToastProvider'; // 위 코드에 해당하는 ToastProvider 경로

jest.mock('lottie-react', () => () => <div>Lottie Mock</div>);

// 테스트용 헬퍼 컴포넌트
const TestComponent = ({errorInfo}: {errorInfo: ErrorInfo}) => {
const {setErrorInfo} = useError();
Expand Down

0 comments on commit 91a3336

Please sign in to comment.