You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to create component tests using Vue Test Utils and Vitest, and tracking the effects of TabsTrigger clicks. When the Tabs component is bound via v-model clicking a tab seemingly does not update the bound attribute. But, manually forcing a click event on the TabsTrigger 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 the v-model directive, and in TestTabsWithManualControl.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 in TestTabs.spec.ts but it passes in TestTabsWithManualControl.spec.ts
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: