diff --git a/src/app/components/Gnb/Gnb.test.tsx b/src/app/components/Gnb/Gnb.test.tsx index c4444528..eb9141f8 100644 --- a/src/app/components/Gnb/Gnb.test.tsx +++ b/src/app/components/Gnb/Gnb.test.tsx @@ -21,9 +21,9 @@ jest.mock('@/public/images', () => ({ Logo: () =>
, })); -// toptab 모킹 +// TopTab 컴포넌트 모킹 jest.mock('../Tab/TopTab', () => { - return ({ + const MockTopTab = ({ isActive, children, }: { @@ -37,23 +37,28 @@ jest.mock('../Tab/TopTab', () => { {children}
); + MockTopTab.displayName = 'MockTopTab'; + return MockTopTab; }); +// Badge 컴포넌트 모킹 jest.mock('../Badge/Badge', () => { - return ({ children }: { children: ReactNode }) => ( + const MockBadge = ({ children }: { children: ReactNode }) => ( {children} ); + MockBadge.displayName = 'MockBadge'; + return MockBadge; }); // UserStatus 컴포넌트 모킹 jest.mock('./UserStatus', () => { - return function MockUserStatus({ + const MockUserStatus = ({ user, token, }: { user: UserData | null; token: string | undefined; - }) { + }) => { return (
{user ? ( @@ -70,6 +75,8 @@ jest.mock('./UserStatus', () => {
); }; + MockUserStatus.displayName = 'MockUserStatus'; + return MockUserStatus; }); // ToggleTheme 컴포넌트 모킹 @@ -77,6 +84,15 @@ jest.mock('./ToggleTheme', () => () => ( )); +// TokenExpirationTimerLayout 컴포넌트 모킹 +jest.mock('./TokenExpirationTimerLayout', () => { + const MockTokenExpirationTimerLayout = () => { + return
타이머
; // 타이머 모킹 + }; + MockTokenExpirationTimerLayout.displayName = 'MockTokenExpirationTimerLayout'; + return MockTokenExpirationTimerLayout; +}); + // TokenExpirationTimerLayout 컴포넌트 모킹 jest.mock('./TokenExpirationTimerLayout', () => { return function MockTokenExpirationTimerLayout() {