From 670366b9ab2610124f2e12e7a1a4d347903b229d Mon Sep 17 00:00:00 2001 From: Suejung Shin Date: Thu, 19 Dec 2024 16:31:57 -0800 Subject: [PATCH] fix test --- src/layouts/BaseLayout/BaseLayout.test.tsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/layouts/BaseLayout/BaseLayout.test.tsx b/src/layouts/BaseLayout/BaseLayout.test.tsx index 05fb57499b..822a362686 100644 --- a/src/layouts/BaseLayout/BaseLayout.test.tsx +++ b/src/layouts/BaseLayout/BaseLayout.test.tsx @@ -595,12 +595,13 @@ describe('BaseLayout', () => { }) describe('When Header has a network call error', async () => { - it('renders the EmptyErrorComponent when header throws an error', async () => { - vi.mock('layouts/Header', () => ({ - default: () => { - throw new Error('Simulated Header Error') - }, - })) + it('renders nothing for the errored header', async () => { + vi.spyOn( + await import('layouts/Header'), + 'default' + ).mockImplementationOnce(() => { + throw new Error('Simulated Header Error') + }) setup({ currentUser: userHasDefaultOrg }) render(hello, { wrapper: wrapper() })