Files
mes-ui-d2/tests/unit/d2-source.spec.js
孙昊翔 e73d7be4c5 no message
Former-commit-id: 0043b5f5d5d3929d432e04a1c29f38ad039ad57c [formerly 0043b5f5d5d3929d432e04a1c29f38ad039ad57c [formerly 0043b5f5d5d3929d432e04a1c29f38ad039ad57c [formerly 0043b5f5d5d3929d432e04a1c29f38ad039ad57c [formerly 62c1c67cf4204ce64685812f1ce66ee7607c08d4 [formerly 9dd74154fcc5f0616ae15f9953c523fc0778a430]]]]]
Former-commit-id: 8705942098de72b8d037068623b0cd85134f9aa6
Former-commit-id: a3c6c9fa65dee6fcb4b020bd31d48d51d581c42f
Former-commit-id: 356b33963109fe654be6f07aceaaf8ba600fc429 [formerly 245b9a094d3ac4631ccece0b8161bd8ef88337d8]
Former-commit-id: 009ad7730d68e708e3354ea32e809b704a36b538
Former-commit-id: d6d00e641c4d14af7a27d61648b44f54a412ce9d
Former-commit-id: 148440c65e18ee7d577f8b4fded3eb6b6a4a0211
Former-commit-id: e79c7dd2c985c10ab3c5f2ecb5c24b3e28f71737
Former-commit-id: 0eeb1b06586af98c04877a7ce4e8cad98e3fc9ff
2019-01-05 09:58:05 +08:00

39 lines
927 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', (done) => {
const wrapper = mount(D2Source, {
stubs: ['d2-icon']
})
expect(wrapper.is('.d2-source')).toBeTruthy()
setTimeout(() => {
expect(wrapper.contains('.d2-source--active')).toBeTruthy()
done()
}, 600)
})
// props
it('has props', () => {
const wrapper = mount(D2Source, {
stubs: ['d2-icon'],
propsData: {
filename: ''
}
})
expect(wrapper.props().filename).toEqual('')
})
})