mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
mock and instead of using vue router
This commit is contained in:
parent
7cde62b843
commit
456b48650b
@ -4,32 +4,12 @@ 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
|
||||
|
||||
@ -49,12 +29,17 @@ describe('Community', () => {
|
||||
$i18n: {
|
||||
locale: 'en',
|
||||
},
|
||||
$router: {
|
||||
push: jest.fn(),
|
||||
},
|
||||
$route: {
|
||||
hash: 'my',
|
||||
},
|
||||
}
|
||||
|
||||
const Wrapper = () => {
|
||||
return mount(Community, {
|
||||
localVue,
|
||||
router,
|
||||
mocks,
|
||||
})
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user