-
Notifications
You must be signed in to change notification settings - Fork 665
Closed
Labels
Description
What problem does this feature solve?
Currently, using CSS Selector, the element binding Vue instance is wrapped by Wrapper.
Using CSS Selector, the element binding Vue instance is wrapped by VueWrapper.
I think it might be necessary and obvious.
What does the proposed API look like?
component.vue
<template>
<div class="foo" />
</template>
<script>
export default {
name: 'component'
}
</script>
component-with-child.vue
<template>
<div>
<span>
<child-component/>
<div class="foo" />
<child-component/>
</span>
</div>
</template>
<script>
import ChildComponent from './component.vue'
export default{
name: 'component-with-child',
components: {
ChildComponent
}
}
</script>
import ComponentWithChild from '~resources/components/component-with-child.vue'
const wrapper = mount(ComponentWithChild);
const wrappers = wrapper.findAll('.foo')
expect(wrappers.at(0)).to.be.an.instanceOf(VueWrapper)
expect(wrappers.at(1)).to.be.an.instanceOf(Wrapper)
expect(wrappers.at(2)).to.be.an.instanceOf(VueWrapper)
kfischer-okarin