unit test: d2-container-frame

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
This commit is contained in:
孙昊翔 2019-01-04 14:52:49 +08:00
parent 100f8a51b0
commit 521b08b6b5
2 changed files with 35 additions and 1 deletions

View File

@ -0,0 +1,35 @@
import { mount } from '@vue/test-utils'
import D2ContainerFrame from '@/components/d2-container-frame/index.vue'
describe('d2-container-frame.vue', () => {
// 存在且是Vue组件实例
it('is a vue instance', () => {
const wrapper = mount(D2ContainerFrame, {
stubs: ['d2-container']
})
expect(wrapper.exists()).toBeTruthy()
expect(wrapper.isVueInstance()).toBeTruthy()
})
// 包含特定类名
it('contains specific classnames', () => {
const wrapper = mount(D2ContainerFrame, {
stubs: ['d2-container']
})
expect(wrapper.contains('.d2-container-frame')).toBeTruthy()
})
// src prop
it('has a property named \'src\'', () => {
const wrapper = mount(D2ContainerFrame, {
stubs: ['d2-container'],
propsData: {
src: 'https://doc.d2admin.fairyever.com/zh/'
}
})
expect(wrapper.props().src).toEqual('https://doc.d2admin.fairyever.com/zh/')
})
})

View File

@ -1,6 +1,5 @@
import { mount, createLocalVue } from '@vue/test-utils'
import D2Source from '@/components/d2-container/components/d2-source.vue'
import util from '@/libs/util'
describe('d2-source.vue', () => {
// 存在且是Vue组件实例