Testing the TaskList Component
Understand how to test the TaskList React component by writing unit tests that confirm all tasks passed through props render correctly. Explore using @testing-library/react functions like render and getByText to verify component output and implement the component to pass these tests.
We'll cover the following...
Test for TaskList
Let’s start by planning out the architecture of the component. Since it is going to be responsible for displaying the tasks, TaskList definitely needs access to those. We will use a tasks prop to pass them down.
The only feature requested from this component right now is to display whichever tasks that we pass in through the tasks prop. We will not assume which components are used to render the tasks themselves. We will only test whether the text of all the tasks is present on the page.
For now, I will skip imports and test definitions, since I covered them already. If you want to revisit it, read over ...