find(selector)

Returns an array of wrappers of DOM nodes or Vue components. Use any valid avoriaz selector.

Arguments

selector (String|Component): a CSS selector ('#id', '.class-name', 'tag') or a Vue component. See selectors.

Returns

(Array): returns an array of wrappers matching selector. Vue component wrappers have extra methods (computed, data, methods, propsData). To check if a wrapper is a Vue component wrapper, use wrapper.isVueComponent.

Example

import { mount } from 'avoriaz';
import Foo from './Foo.vue';

const wrapper = mount(Foo);
const div = wrapper.find('div')[0];
expect(div.is('div')).to.equal(true);

With a Vue Component:

import { mount } from 'avoriaz';
import Foo from './Foo.vue';
import Bar from './Bar.vue'

const wrapper = mount(Foo);
const bar = wrapper.find(Bar)[0];
expect(bar.isVueComponent).to.equal(true);

results matching ""

    No results matching ""