test unit: d2-module-index-menu
Former-commit-id: 8eeb1f1c897e306b0f76d8e7faf2b785a28ee80f [formerly 8eeb1f1c897e306b0f76d8e7faf2b785a28ee80f [formerly 8eeb1f1c897e306b0f76d8e7faf2b785a28ee80f [formerly 8eeb1f1c897e306b0f76d8e7faf2b785a28ee80f [formerly e6938e58db88e2e5857c3dddef8ae4d978a0a98c [formerly 3c43aecc4eeaef75aeebb74b21a357574830a5d2]]]]] Former-commit-id: 72e71967a8ae4e5865837c6b7adcf56c610a096d Former-commit-id: 5617cf5c00326a09148f33f20865db85cbee4aab Former-commit-id: 745207dbc2ffa248c38bdd2593de37c622719cbe [formerly 76533a188618268d796eadd0f740fe4b1bb2c712] Former-commit-id: 5a318187d62a33df65d321c755c5945e0a574936 Former-commit-id: 46496e8c6ea56714594df7c26a7efe7eba1b601a Former-commit-id: 95fdbf702145f90678b51e44c943671cc895419b Former-commit-id: b2b95ddb9cd27f8b12fdcff9a67a9e3536165a41 Former-commit-id: 142b535174ef9657ff743c3b0f2c0866d009a26a
This commit is contained in:
parent
038ce98e5f
commit
69551c5afa
|
|
@ -0,0 +1,36 @@
|
|||
import { mount } from '@vue/test-utils'
|
||||
import D2ModuleIndexMenu from '@/components/d2-module-index-menu/index.vue'
|
||||
import menu from '@/menu/modules/demo-business'
|
||||
|
||||
describe('d2-module-index-menu', () => {
|
||||
// 存在且是Vue组件实例
|
||||
it('is a vue instance', () => {
|
||||
const wrapper = mount(D2ModuleIndexMenu, {
|
||||
stubs: ['el-button'],
|
||||
propsData: {
|
||||
menu
|
||||
}
|
||||
})
|
||||
|
||||
expect(wrapper.exists()).toBeTruthy()
|
||||
expect(wrapper.isVueInstance()).toBeTruthy()
|
||||
})
|
||||
|
||||
// 300m后正确渲染,包含特定类名
|
||||
it('contains specific classnames', (done) => {
|
||||
const wrapper = mount(D2ModuleIndexMenu, {
|
||||
stubs: ['el-button'],
|
||||
propsData: {
|
||||
menu: menu
|
||||
}
|
||||
})
|
||||
|
||||
setTimeout(() => {
|
||||
expect(wrapper.is('.d2-module-index-menu')).toBeTruthy()
|
||||
expect(wrapper.contains('.d2-module-index-menu-group')).toBeTruthy()
|
||||
expect(wrapper.contains('.d2-module-index-menu-group--title')).toBeTruthy()
|
||||
expect(wrapper.contains('.d2-module-index-menu-item')).toBeTruthy()
|
||||
done()
|
||||
}, 400)
|
||||
})
|
||||
})
|
||||
Loading…
Reference in New Issue