testing-library / cypress-testing-library

🐅 Simple and complete custom Cypress commands and utilities that encourage good testing practices.
http://npm.im/@testing-library/cypress
MIT License
1.8k stars 152 forks source link

Enable to click to input number -webkit-inner-spin-button #245

Closed MehmetCanBOZ closed 1 year ago

MehmetCanBOZ commented 1 year ago

Relevant code or config

cy.findByRole('spinbutton::-webkit-inner-spin-button').click()

What you did: I design an input number component that only changes with the -webkit-inner-spin-button and -webkit-inner-outer-button between the min and max value which was given the input

What happened: I can not select -webkit-inner-spin-button and -webkit-inner-outer-button and click it.

Reproduction repository: example react code

Problem description: I design an input number component that only changes with the -webkit-inner-spin-button and -webkit-inner-outer-button between the min and max value which was given the input, if the user types a value with the keyboard, I control with a custom handler function and give an error, not the change the value of the input.But the problem is I can not test it, because I can not select -webkit-inner-spin-button and -webkit-inner-outer-button and click it.

Suggested solution: I want to click spinbutton -webkit-inner-spin-button and -webkit-outer-spin-button.

MehmetCanBOZ commented 1 year ago

https://github.com/cypress-io/cypress/issues/25022#issuecomment-1352119866