How to use the unit testing pattern Arrange Act Assert, and why the three As are so useful. Example of how to use arrange-act-assert with a JS function.
Solution for testing that images have rendered in React using Jest. And how to test an image alt and src in jest using React. Including example code.
How to mock a React component in a jest unit test. Example of how to mock a default or named component using React Testing Library.
Examples of how to use within in Jest and React Testing Library to target a specific section of the component. Restrict Jest queries to a particular element. Inside the context of a DOM node.
How to unit test a React parent component logic, and check that a child component is passed the correct props. Test if a component is called with expected argument using React Testing Library.