-
-
Save lmiller1990/287460532914aea711df803c85dfef1f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { shallowMount, mount, createLocalVue } from "@vue/test-utils" | |
import App from "@/App.vue" | |
import VueRouter from "vue-router" | |
import NestedRoute from "@/components/NestedRoute.vue" | |
import routes from "@/routes.js" | |
const localVue = createLocalVue() | |
localVue.use(VueRouter) | |
describe("App", () => { | |
it("renders a child component via routing", () => { | |
const router = new VueRouter({ routes }) | |
const wrapper = mount(App, { localVue, router }) | |
router.push("/nested-route") | |
expect(wrapper.find(NestedRoute).exists()).toBe(true) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment