Closed ardentum-c closed 3 months ago
Please, just delete the issue. (Sorry for that mess) I've accidently submitted the form by a hotkey, tried to make it more meaningful, but decided to take a step back and investigate the issue more by myself.
I guess there is still some weird behavior here, but don't want to bother you with poorly prepared issue report. Will return in case there will be more.
Describe the bug
Hello! I was playing with some async press handlers for my component, and noticed a weird behavior. It seems like DEFAULT_MIN_PRESS_DURATION from
/src/user-event/press/constants.ts
affects jest timers in an unexpected way and makes it difficult to test press events in combination with timers.Here is a synthetic test case that reproduces the bug. Right now it works only because I am subtracting 130ms (PRESSABLE_DELAY) from the expected time to wait for.
Expected behavior
I am not sure what is the best way to handle that, but the current behavior is confusing and requires an investigation from a developer to understand what is happening.
Maybe it should use the Pressable's unstable_pressDelay prop?
Versions