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: '
body
', header: '
header
', footer: '
footer
' } }) expect(wrapper.html()).toContain('
body
') expect(wrapper.html()).toContain('
header
') expect(wrapper.html()).toContain('') }) })