Selecting an Option in a select Element
Understand how to simulate user interactions by selecting options within single and multi-select elements in React forms. This lesson guides you through using user-event's selectOptions function to write effective Jest tests that ensure correct form submission with chosen options.
We'll cover the following...
We'll cover the following...
The starter project contains the same ContactForm component as the previous lesson. It also includes a half-implemented test that checks that the form is successfully submitted.
A copy of the code is in the code widget below. Click the “Run” button to run the tests.
export default "test-file-stub";
Half implemented test