Skip to content

Latest commit

 

History

History
23 lines (16 loc) · 494 Bytes

findAllComponents.md

File metadata and controls

23 lines (16 loc) · 494 Bytes

findAllComponents

Returns a WrapperArray of all matching Vue components.

  • Arguments:

    • {Component|ref|name} 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 bar = wrapper.findAllComponents(Bar).at(0)
expect(bar.exists()).toBeTruthy()
const bars = wrapper.findAllComponents(Bar)
expect(bar).toHaveLength(1)