Skip to content

Commit

Permalink
Add AlertProvider to test renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
negreirosleo committed Dec 14, 2023
1 parent 5da10c3 commit daabb82
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion frontend/src/test-utils/test-utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@ import React, { ReactElement } from 'react'
import { render, RenderOptions } from '@testing-library/react'

import { CssVarsProvider } from '@mui/joy/styles'
import { AlertProvider } from '@/ui/Alert/AlertProvider'
import { theme } from '@/ui/theme'
import userEvent, { Options } from '@testing-library/user-event'

const AllTheProviders = ({ children }: { children: React.ReactNode }) => {
return <CssVarsProvider theme={theme}>{children}</CssVarsProvider>
return (
<AlertProvider>
<CssVarsProvider theme={theme}>{children}</CssVarsProvider>
</AlertProvider>
)
}

const customRender = (ui: ReactElement, options?: Omit<RenderOptions, 'wrapper'>) =>
Expand Down

0 comments on commit daabb82

Please sign in to comment.