Skip to content

Latest commit

 

History

History
32 lines (21 loc) · 761 Bytes

findAll.md

File metadata and controls

32 lines (21 loc) · 761 Bytes

findAll

::: warning Deprecation warning Using findAll to search for Components is deprecated and will be removed. Use findAllComponents instead. The findAll method will continue to work for finding elements using any valid selector. :::

Returns a WrapperArray.

Use any valid selector.

  • Arguments:

    • {string|Component} selector
  • Returns: {WrapperArray}

  • Example:

import { mount } from '@vue/test-utils'
import Foo from './Foo.vue'
import Bar from './Bar.vue'

const wrapper = mount(Foo)

const div = wrapper.findAll('div').at(0)
expect(div.is('div')).toBe(true)

const bar = wrapper.findAll(Bar).at(0) // Deprecated usage
expect(bar.is(Bar)).toBe(true)