-
Hello, I’m currently experiencing an issue when trying to set a value for the In my tests, I am unable to set a value for the Please note that unit tests are not runnable in StackBlitz. You will need to download the repository and run the tests locally:
I would appreciate any help or guidance on how to set the value for the Combobox correctly in unit tests using Vue Test Utils. Thank you in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
I'm not familiar with headlessui components, but a quick look in their codebase shows a ton of unit tests for combobox in https://github.com/tailwindlabs/headlessui/blob/main/packages/%40headlessui-vue/src/components/combobox/combobox.test.ts So you can probably find some inspiration even if they don't use test-utils. |
Beta Was this translation helpful? Give feedback.
It looks like they are not listening to clicks but to mousedown on options https://github.com/tailwindlabs/headlessui/blob/0a8de016e8f4f6f3c27fdebe8fe79debdd2ae4fb/packages/%40headlessui-vue/src/components/combobox/combobox.ts#L1475
If that's not enough, I think your best shot is to ask the question on the headlessui repo, as this is not really an issue with VTU but rather an implementation detail of headlessui to figure out in order to make your test pass