Skip to content

Commit 59283d0

Browse files
committed
docs: update selector docs
1 parent 9c6abc4 commit 59283d0

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

docs/en/api/selectors.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ You can also use combinators:
2323

2424
Vue components are also valid selectors.
2525

26-
`vue-test-utils` uses the `name` property to search the instance tree for matching Vue components.
27-
2826
```js
2927
// Foo.vue
3028

@@ -44,6 +42,15 @@ expect(wrapper.is(Foo)).toBe(true)
4442

4543
## Find Option Object
4644

45+
### Name
46+
47+
Using a find option object, `vue-test-utils` allows for selecting elements by `name` on wrapper components.
48+
49+
```js
50+
const buttonWrapper = wrapper.find({ name: 'my-button' })
51+
buttonWrapper.trigger('click')
52+
```
53+
4754
### Ref
4855

4956
Using a find option object, `vue-test-utils` allows for selecting elements by `$ref` on wrapper components.

0 commit comments

Comments
 (0)