Skip to content

Commit 3b8d376

Browse files
Ref selection doc updates
issue: vuejs#177
1 parent 55bf315 commit 3b8d376

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

docs/en/api/selectors.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Selectors
22

3-
A lot of methods take a selector as an argument. A selector can either be a CSS selector, or a Vue component.
3+
A lot of methods take a selector as an argument. A selector can either be a CSS selector, a Vue component, or a find option object.
44

55
## CSS Selectors
66

@@ -41,3 +41,14 @@ import Foo from './Foo.vue'
4141
const wrapper = shallow(Foo)
4242
expect(wrapper.is(Foo)).toBe(true)
4343
```
44+
45+
## Find Option Object
46+
47+
### Ref
48+
49+
Using a find option object, vue-test-utils allows for selecting elements by $ref on wrapper components.
50+
51+
```js
52+
const buttonWrapper = wrapper.find({ ref: 'myButton' });
53+
buttonWrapper.trigger('click');
54+
```

0 commit comments

Comments
 (0)