MCPcopy
hub / github.com/gitify-app/gitify / renderWithProviders

Function renderWithProviders

src/renderer/__helpers__/test-utils.tsx:101–116  ·  view source on GitHub ↗
(
  ui: ReactElement,
  { initialEntries, filters, ...context }: RenderOptions = {},
)

Source from the content-addressed store, hash-verified

99 * renderWithProviders(<MyComponent />, { notifications, accounts, settings, filters, ... })
100 */
101export 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}

Calls

no outgoing calls

Tested by 1

renderWithContextFunction · 0.72