Exercise: Types of Components
Explore how to implement tests for different React components, including pages and custom hooks. Learn to verify UI rendering, loading states, and interaction handling to build robust applications.
We'll cover the following...
We'll cover the following...
The starter project contains an app that allows a user to view and add notes.
The project already contains some tests. In this exercise, you’ll add additional tests to the following components and custom hooks:
-
HomePage -
NewNotePage -
useNoteField -
useGetNotes -
useSaveNote
Skeleton code is given below:
export default "test-file-stub";
Testing playground
HomePage tests
The tests on the HomePage component should verify the following:
-
The correct page title is ...