(
ui: ReactElement,
{ initialEntries, filters, ...context }: RenderOptions = {},
)
| 99 | * renderWithProviders(<MyComponent />, { notifications, accounts, settings, filters, ... }) |
| 100 | */ |
| 101 | export function renderWithProviders( |
| 102 | ui: ReactElement, |
| 103 | { initialEntries, filters, ...context }: RenderOptions = {}, |
| 104 | ) { |
| 105 | if (filters) { |
| 106 | useFiltersStore.setState(filters); |
| 107 | } |
| 108 | |
| 109 | return render(ui, { |
| 110 | wrapper: ({ children }) => ( |
| 111 | <AppContextProvider initialEntries={initialEntries} value={context}> |
| 112 | {children} |
| 113 | </AppContextProvider> |
| 114 | ), |
| 115 | }); |
| 116 | } |
no outgoing calls