mirror of
https://gitee.com/ssssssss-team/magic-boot.git
synced 2025-02-12 22:37:21 +08:00
35 lines
701 B
JavaScript
35 lines
701 B
JavaScript
![]() |
import { mount, createLocalVue } from '@vue/test-utils'
|
||
|
import VueRouter from 'vue-router'
|
||
|
import ElementUI from 'element-ui'
|
||
|
import Breadcrumb from '@/components/Breadcrumb/index.vue'
|
||
|
|
||
|
const localVue = createLocalVue()
|
||
|
localVue.use(VueRouter)
|
||
|
localVue.use(ElementUI)
|
||
|
|
||
|
const routes = [
|
||
|
{
|
||
|
path: '/',
|
||
|
name: 'home',
|
||
|
children: [{
|
||
|
path: 'dashboard',
|
||
|
name: 'dashboard'
|
||
|
}]
|
||
|
}]
|
||
|
|
||
|
const router = new VueRouter({
|
||
|
routes
|
||
|
})
|
||
|
|
||
|
describe('Breadcrumb.vue', () => {
|
||
|
const wrapper = mount(Breadcrumb, {
|
||
|
localVue,
|
||
|
router
|
||
|
})
|
||
|
it('dashboard', () => {
|
||
|
router.push('/dashboard')
|
||
|
const len = wrapper.findAll('.el-breadcrumb__inner').length
|
||
|
expect(len).toBe(1)
|
||
|
})
|
||
|
})
|