We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 55bf315 commit 3b8d376Copy full SHA for 3b8d376
docs/en/api/selectors.md
@@ -1,6 +1,6 @@
1
# Selectors
2
3
-A lot of methods take a selector as an argument. A selector can either be a CSS selector, or a Vue component.
+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.
4
5
## CSS Selectors
6
@@ -41,3 +41,14 @@ import Foo from './Foo.vue'
41
const wrapper = shallow(Foo)
42
expect(wrapper.is(Foo)).toBe(true)
43
```
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