diff --git a/frontend/src/pages/Community.spec.js b/frontend/src/pages/Community.spec.js index 26d30c1d9..1f668683e 100644 --- a/frontend/src/pages/Community.spec.js +++ b/frontend/src/pages/Community.spec.js @@ -4,12 +4,32 @@ import { toastErrorSpy, toastSuccessSpy } from '@test/testSetup' import { createContribution, updateContribution, deleteContribution } from '@/graphql/mutations' import { listContributions, listAllContributions, verifyLogin } from '@/graphql/queries' +import VueRouter from 'vue-router' +import routes from '../routes/routes' + const localVue = global.localVue +localVue.use(VueRouter) const mockStoreDispach = jest.fn() const apolloQueryMock = jest.fn() const apolloMutationMock = jest.fn() +const router = new VueRouter({ + base: '/', + routes, + linkActiveClass: 'active', + mode: 'history', + // scrollBehavior: (to, from, savedPosition) => { + // if (savedPosition) { + // return savedPosition + // } + // if (to.hash) { + // return { selector: to.hash } + // } + // return { x: 0, y: 0 } + // }, +}) + describe('Community', () => { let wrapper @@ -34,6 +54,7 @@ describe('Community', () => { const Wrapper = () => { return mount(Community, { localVue, + router, mocks, }) }