Testing components that use the Context API
In this section, we will learn how to test components that use the React library's Context API to manage state. The Context API helps solve issues related to passing props and methods multiple levels down the component tree, similar to Redux. The Context API allows you to directly send data to consumers without traveling through numerous parent-level components to get to the target consumer. An example application where the state could be more easily managed with the Context API is a website that allows users to change the theme from light to dark because multiple components would need to be aware when the theme changes. Another example would be a complex social networking site such as Twitter. Components that use Context must be used within the Context Provider
component:
import { LikesProvider } from './LikesContext' import Vote from './Vote' const App = () => ( <LikesProvider initialLikes=...