-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Tabs v-model not updating in test utils/vitest #543
Comments
Try swapping to Internally Radix Vue uses the |
Thanks for the reply @zernonia. Unfortunately, that doesn't seem to work in the stackblitz. I'm seeing something similar with the dialog component, but I'm noticing there in Radix-Vue you're using a different methodology to trigger it to open. I'll see if that works for my situation here, as well. |
Reproduction
https://stackblitz.com/~/github.com/jeffpohlmeyer/shadcn-vitest
Describe the bug
Trying to create component tests using Vue Test Utils and Vitest, and tracking the effects of
TabsTrigger
clicks. When theTabs
component is bound viav-model
clicking a tab seemingly does not update the bound attribute. But, manually forcing a click event on theTabsTrigger
does update the value in tests.In looking through the repro, you'll see what I mean if you look at
TestTabs.vue
to see it with two-way binding via thev-model
directive, and inTestTabsWithManualControl.vue
you'll see the explicit click event handler.If you open a second terminal in the project once it opens and simply run
vitest
in the terminal you'll see that the test fails inTestTabs.spec.ts
but it passes inTestTabsWithManualControl.spec.ts
System Info
Contributes
The text was updated successfully, but these errors were encountered: