You just render the context with your component.
const addItem = jest.fn()
render(
<AppContext.Provider value={{ addItem }}>
<MyComponent />
</AppContext.Provider>
)
See Mocking context with react-testing-library
You just render the context with your component.
const addItem = jest.fn()
render(
<AppContext.Provider value={{ addItem }}>
<MyComponent />
</AppContext.Provider>
)
See Mocking context with react-testing-library