We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b64146c commit af94764Copy full SHA for af94764
tests/unit/components/VTag.spec.js
@@ -0,0 +1,25 @@
1
+import { mount, createLocalVue } from "@vue/test-utils";
2
+
3
+import router from "../../../src/router/index";
4
+import VTag from "../../../src/components/VTag";
5
6
+const localVue = createLocalVue();
7
+const createWrapper = () => {
8
+ return mount(VTag, {
9
+ localVue,
10
+ router,
11
+ propsData: {
12
+ name: "Foo"
13
+ }
14
+ });
15
+};
16
17
+describe("VTag", () => {
18
+ it("should update the route on click", async () => {
19
+ const wrapper = createWrapper();
20
+ const routerBefore = wrapper.vm.$route.path;
21
+ wrapper.find("a").trigger("click");
22
+ await localVue.nextTick();
23
+ expect(wrapper.vm.$route.path).not.toBe(routerBefore);
24
25
+});
0 commit comments