Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
suejung-sentry committed Dec 20, 2024
1 parent 8ca9af9 commit 670366b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/layouts/BaseLayout/BaseLayout.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(<BaseLayout>hello</BaseLayout>, { wrapper: wrapper() })
Expand Down

0 comments on commit 670366b

Please sign in to comment.