diff --git a/src/tabbar/test/__snapshots__/index.spec.js.snap b/src/tabbar/test/__snapshots__/index.spec.js.snap index 9904a7823..d9d4f9391 100644 --- a/src/tabbar/test/__snapshots__/index.spec.js.snap +++ b/src/tabbar/test/__snapshots__/index.spec.js.snap @@ -10,7 +10,7 @@ exports[`placeholder prop 1`] = ` exports[`route mode 1`] = `
-
+
diff --git a/src/tabbar/test/index.spec.js b/src/tabbar/test/index.spec.js index 0200eb062..f5ed73bc0 100644 --- a/src/tabbar/test/index.spec.js +++ b/src/tabbar/test/index.spec.js @@ -1,15 +1,25 @@ import VueRouter from 'vue-router'; -import { mount, later, mockGetBoundingClientRect } from '../../../test'; +import { later, mockGetBoundingClientRect, mount } from '../../../test'; import Vue from 'vue'; import Tabbar from '..'; +import { createLocalVue } from '@vue/test-utils'; Vue.use(VueRouter); test('route mode', async () => { - const router = new VueRouter(); - const wrapper = mount({ - router, - template: ` + const router = new VueRouter({ + routes: [ + { path: '/', component: { render: () => '/' } }, + { path: '/search', component: { render: () => '/search' } }, + { path: '/star', component: { render: () => '/star' } }, + ], + }); + const localVue = createLocalVue(); + localVue.use(VueRouter); + + const wrapper = mount( + { + template: ` Tab @@ -25,7 +35,9 @@ test('route mode', async () => { `, - }); + }, + { localVue, router } + ); expect(wrapper).toMatchSnapshot();