Verify Cypress Component Prop Calls Using Stubs, cypress-map, and cy-spok @gleb
Verify Cypress Component Prop Calls Using Stubs, cypress-map, and cy-spok  @gleb
Uploaded July 2023 | Updated November 2026, 3 days ago
This video shows how to mount a react-number-format component in a Cypress component spec and pass a Sinon stub as a prop. Then we can interact with the component: clear it, then type a number. We can verify the stub was called correctly in several ways. My favorite is to use either cypress-map command "cy.map" (github.com/bahmutov/cypress-map) and "deep.equal" assertion, or by using cy-spok plugin (github.com/bahmutov/cy-spok). You should also read the blog post "Testing React Number Format Component Example" glebbahmutov.com/blog/test-react-number-format
Verify Cypress Component Prop Calls Using Stubs, cypress-map, and cy-spok
gleb bahmutov |

Verify Cypress Component Prop Calls Using Stubs, cypress-map, and cy-spok

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER