Files
mes-ui-d2/tests/unit/d2-source.spec.js
孙昊翔 59c5ffd751 no message
Former-commit-id: faefc4c6e727523a2e3cfee920c7f6b2f0b059aa [formerly faefc4c6e727523a2e3cfee920c7f6b2f0b059aa [formerly faefc4c6e727523a2e3cfee920c7f6b2f0b059aa [formerly faefc4c6e727523a2e3cfee920c7f6b2f0b059aa [formerly bdde2f0b3e39efac98f19601130b7ad9277284ab [formerly bc029c9b4beffa1cbfb2cf770a095fd02ae76b62]]]]]
Former-commit-id: b8e2d229a71661a8450363150629f205ad8a1fee
Former-commit-id: 3c4084ff94884082ad4e7f9b620b0270285ac56b
Former-commit-id: 2631c293b256421423f26b01acfe6fc7e7f81153 [formerly 04739fef9aea219063b7683b0f7396fb969c2275]
Former-commit-id: 5306047eae9b783386d3090cdf9f9431d4b57deb
Former-commit-id: 1d04632c22798a967256c7a5e6b5392f62c07e54
Former-commit-id: 437f55ac3308b54cf5e0c3ed0e8bf258fc4acb09
Former-commit-id: 340153cd8d7760323a6df93c9513f935b13d9440
Former-commit-id: c472df368e6f81c21531fd40f1fd09c440b337ac
2019-01-05 10:18:44 +08:00

39 lines
923 B
JavaScript

import { mount, createLocalVue } from '@vue/test-utils'
import D2Source from '@/components/d2-container/components/d2-source.vue'
describe('d2-source', () => {
// 存在且是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('')
})
})