-
Hello, I’m currently facing an issue when trying to set a value for the Combobox component in my unit tests. I’ve simplified the problem to create a minimal example that reproduces the issue, which you can view here: StackBlitz Example. In my tests, I’m unable to properly set the value for the Combobox component, and I'm unsure of the correct approach to do so. Please note that unit tests are not runnable in Stack Blitz, you will have to download the repository and locally :
I would appreciate any guidance or recommendations on how to correctly set a value for the Combobox component in unit tests. Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hello, I wanted to follow up on my question as I haven’t received a response yet. I’ve been trying to set a value for the Combobox component in my unit tests using Vue Test Utils, but I’m still stuck. To make debugging easier, I updated my StackBlitz example and attempted to reproduce one of Headless UI’s own unit tests: I also removed MSW, so you can now run => https://stackblitz.com/edit/vitejs-vite-3frophzj If anyone has any insights on how to properly test this with Vue Test Utils, I’d greatly appreciate the help! Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Hello,
I just wanted to leave an update for anyone who comes across this topic. The problem was that the
Combobox
component from Headless UI listens tomousedown
instead ofclick
. Adjusting my test to usemousedown
instead ofclick
resolved the issue.Also, the StackBlitz example is now up to date with the working test, so you can check it out here: https://stackblitz.com/edit/vitejs-vite-3frophzj
I hope this helps anyone facing a similar problem! 😄