Component:
<template>
<MyComponent>
<div class="in-slot">Hello world</div>
</MyComponent>
</template>
How to get access to div.in-slot and test his text?
Component:
<template>
<MyComponent>
<div class="in-slot">Hello world</div>
</MyComponent>
</template>
How to get access to div.in-slot and test his text?
If we suppose that you imported the parent component as MyParentComponent in your test file, this should work:
const wrapper = mount(MyParentComponent, {options})
expect(wrapper.find('.in-slot').text()).toBe('Hello world')