【发布时间】:2023-02-06 18:14:18
【问题描述】:
我需要使用 Vue 使用 Cypress 组件测试在插槽中导入一个组件。
文档说对于插槽:
import DefaultSlot from './DefaultSlot.vue'
describe('<DefaultSlot />', () => {
it('renders', () => {
cy.mount(DefaultSlot, {
slots: {
default: 'Hello there!',
},
})
cy.get('div.content').should('have.text', 'Hello there!')
})
})
我想这样做:
<DefaultSlot>
<AnotherSlot />
</DefaultSlot>
【问题讨论】:
标签: javascript vue.js testing cypress