Former-commit-id: c032c3e36f928fe7daf009eb09e232e1f584bd87 [formerly c032c3e36f928fe7daf009eb09e232e1f584bd87 [formerly c032c3e36f928fe7daf009eb09e232e1f584bd87 [formerly c032c3e36f928fe7daf009eb09e232e1f584bd87 [formerly b43dff25908611ddd33578f7e1c88f04c83a9fbe [formerly 333f9d73a531287cb3df345ce536fd5a686db1f4]]]]] Former-commit-id: ce91bf166da5e6398fed2b6fe9365a5cc6da8084 Former-commit-id: e98d32ee8e69ab123577ee69485878e55f8af1cb Former-commit-id: db26dedc0cc4903581ce6317aebd24e9dd51ec26 [formerly 156e4f86387dc1c177df774beef8ca35adcf654a] Former-commit-id: b86ce1d37d3f86fa24b91be58852922e1f1df3e5 Former-commit-id: 28f40604fd11f9939fe5780652b571d85e1573be Former-commit-id: 60e02a7facc69965b2c10ba29ae493cfc279d062 Former-commit-id: fc66ed7299d7136a69ec7d3c5c98acebeaa99968 Former-commit-id: 7491a4d6e71073af442fb0dfcd5d81df9b5dfe8f
38 lines
942 B
JavaScript
38 lines
942 B
JavaScript
import { mount, createLocalVue } from '@vue/test-utils'
|
|
import D2Source from '@/components/d2-container/components/d2-source.vue'
|
|
|
|
describe('d2-source.vue', () => {
|
|
// 存在且是Vue组件实例
|
|
it('is a vue instance', () => {
|
|
const wrapper = mount(D2Source, {
|
|
stubs: ['d2-icon']
|
|
})
|
|
|
|
expect(wrapper.exists()).toBeTruthy()
|
|
expect(wrapper.isVueInstance()).toBeTruthy()
|
|
})
|
|
|
|
// 包含特定类名
|
|
it('contains specific classnames', () => {
|
|
const wrapper = mount(D2Source, {
|
|
stubs: ['d2-icon']
|
|
})
|
|
|
|
expect(wrapper.is('.d2-source')).toBeTruthy()
|
|
setTimeout(() => {
|
|
expect(wrapper.contains('.d2-source--active')).toBeTruthy()
|
|
}, 500)
|
|
})
|
|
|
|
// filename prop
|
|
it('has a property named \'filename\'', () => {
|
|
const wrapper = mount(D2Source, {
|
|
stubs: ['d2-icon'],
|
|
propsData: {
|
|
filename: ''
|
|
}
|
|
})
|
|
|
|
expect(wrapper.props().filename).toEqual('')
|
|
})
|
|
}) |