unit test: d2-container-card

Former-commit-id: 48d931936fc9b2c725809e635eee8c285d3aea34 [formerly 48d931936fc9b2c725809e635eee8c285d3aea34 [formerly 48d931936fc9b2c725809e635eee8c285d3aea34 [formerly 48d931936fc9b2c725809e635eee8c285d3aea34 [formerly c316da7b31b6834d93b738111dae3a2ef0a10682 [formerly f9caff63c4c5f796dc5e36916635d87daf61fbf4]]]]]
Former-commit-id: aad578e2165c0b19af7b5c34553a0303f5ae6c5d
Former-commit-id: a8ca3a5837920de6fdb9937dc0814d68409dad15
Former-commit-id: 26633580ac2ddf75c35d39e03980929bf5a2042a [formerly 7fccc7a37199fd218431041c6485caade31f01ea]
Former-commit-id: 7ca17273ca38ac100c0bcf5df9f3e2a8f1a9f3bc
Former-commit-id: af143d96ae4b2ccf1f27e68d56501e987267e698
Former-commit-id: eccbeeb347b396b1f56f1664f4c1d3b5561bccae
Former-commit-id: 1863fc23c5d381e0009df79653699769cd6b35bb
Former-commit-id: cc303cf404d41e310e5225c0de1bd96d29305a41
This commit is contained in:
孙昊翔 2019-01-03 22:01:25 +08:00
parent 754151b628
commit 75d8840995
2 changed files with 22 additions and 14 deletions

View File

@ -1,14 +0,0 @@
// 暂时 D2 没有单元测试代码 此文件为自动生成
import { shallowMount } from '@vue/test-utils'
import HelloWorld from '@/components/HelloWorld.vue'
describe('HelloWorld.vue', () => {
it('renders props.msg when passed', () => {
const msg = 'new message'
const wrapper = shallowMount(HelloWorld, {
propsData: { msg }
})
expect(wrapper.text()).toMatch(msg)
})
})

View File

@ -0,0 +1,22 @@
// 暂时 D2 没有单元测试代码 此文件为自动生成
// import { shallowMount } from '@vue/test-utils'
// import HelloWorld from '@/components/HelloWorld.vue'
import { mount } from '@vue/test-utils'
import D2ContainerCard from '@/components/d2-container/components/d2-container-card.vue'
describe('d2-container-card.vue', () => {
it('渲染slot', () => {
const wrapper = mount(D2ContainerCard, {
slots: {
default: '<div>body</div>',
header: '<div>header</div>',
footer: '<div>footer</div>'
}
})
expect(wrapper.html()).toContain('<div class="d2-container-card__body"><div class="d2-container-card__body-card"><div>body</div></div>')
expect(wrapper.html()).toContain('<div class="d2-container-card__header"><div>header</div></div>')
expect(wrapper.html()).toContain('<div class="d2-container-card__footer"><div>footer</div></div>')
})
})