Skip to content

Latest commit

 

History

History
27 lines (19 loc) · 643 Bytes

find.md

File metadata and controls

27 lines (19 loc) · 643 Bytes

find(selector)

最初の DOM ノードの Wrapper、またはセレクタで一致した Vue コンポーネントを返します。

有効なセレクタを使用してください。

  • 引数:

    • {string|Component} selector
  • 戻り値: {Wrapper}

  • 例:

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

const wrapper = mount(Foo)
const div = wrapper.find('div')
expect(div.is('div')).toBe(true)
const bar = wrapper.find(Bar)
expect(bar.is(Bar)).toBe(true)