You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pleroma-fe/test/unit/specs/boot/routes.spec.js

30 lines
699 B

import routes from 'src/boot/routes'
import { createLocalVue } from '@vue/test-utils'
import VueRouter from 'vue-router'
const localVue = createLocalVue()
localVue.use(VueRouter)
describe('routes', () => {
const router = new VueRouter({
mode: 'abstract',
routes: routes({})
})
it('root path', () => {
router.push('/~/main/all')
6 years ago
const matchedComponents = router.getMatchedComponents()
6 years ago
expect(matchedComponents[0].components.hasOwnProperty('Timeline'))
})
it('user\'s profile', () => {
router.push('/fake-user-name')
6 years ago
const matchedComponents = router.getMatchedComponents()
6 years ago
expect(matchedComponents[0].components.hasOwnProperty('UserProfile'))
})
})