Introduction and Clicking Elements

Learn two different approaches for simulating a DOM click event in a test and determine the best approach in this lesson.

The starter project contains a ContactForm component that captures some information and displays a “Save” button to submit it. A half-implemented test checks that a validation error appears for a Name field when it isn’t filled when the form is submitted.

A copy of the project is in the code widget below. Clicking the “Run” button will run the app and display the form.

Get hands-on with 1400+ tech skills courses.