I have added the Cypress Vue Component Test runner to an existing Vue(vite) app. However, when I run the test I get an error that the $route in my component is undefined. Am I missing something with my component test setup? maybe regarding vue router?
The test setup:
import { mount } from "@cypress/vue";
import ProductListContainer from "./ProductListContainer.vue";
it("renders a message", () => {
mount(ProductListContainer);
...
});
The template:
<template>
//...
<template #pagination>
<nav-pagination
:page-count="meta ? meta.pageCount : 0"
:route-query="$route.query"
/>
</template
</template>
The error:
TypeError
Cannot read property 'query' of undefined
The console log line:
....
"route-query": _ctx.$route.query