Challenge: Cypress Spies

Learn and practice using spies for Cypress component testing.

We'll cover the following

Let’s practice using spies with a challenge.

Task

Starting from line 13, write a component test that asserts that when you render your Button component with the disabled value set to true, the button is disabled.

Starting from line 17, write a component test that asserts that when you render your Button component with the disabled value set to true and a user clicks on it (disregarding that it’s disabled) the onClick handler doesn’t get called.

Get hands-on with 1200+ tech skills courses.