From f00b49c79b09e787af4ffeda2840daac7386b842 Mon Sep 17 00:00:00 2001 From: hakyoung12 Date: Tue, 15 Oct 2024 17:03:51 +0900 Subject: [PATCH] =?UTF-8?q?[KAN-46]=20chore:=20display=20name=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/components/Gnb/Gnb.test.tsx | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) 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() {