Open
Description
Subject of the issue
RouterLink.useLink
is missing when using RouterLinkStub
.
Steps to reproduce
- Set up an empty project with Vite + Vitest + Vue3 + Vuetify3 + Vue Test Utils.
- Use
VBtn
with theto
prop somewhere, e.g.MyComponent.vue
:<template> <v-btn to="home">Home</v-btn> </template>
- Use
RouterLinkStub
in a test:// @vitest-environment jsdom import { mount, RouterLinkStub } from "@vue/test-utils"; import { createVuetify } from "vuetify"; import MyComponent from "./MyComponent.vue"; test("MyComponent", async () => { mount(MyComponent, { global: { stubs: { RouterLink: RouterLinkStub, }, plugins: [createVuetify()], }, }); });
Expected behaviour
MyComponent
is mounted in the test, and VBtn
works.
Actual behaviour
TypeError: RouterLink.useLink is not a function.
Possible Solution
Include the RouterLink.useLink
function in the stub, since it seems to be part of the API.
Metadata
Metadata
Assignees
Labels
No labels