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 0a72913 commit d86684dCopy full SHA for d86684d
docs/api/options.md
@@ -74,6 +74,37 @@ const wrapper = shallowMount(Component, {
74
expect(wrapper.find('div')).toBe(true)
75
```
76
77
+You can also provide slots components with props.
78
+Example:
79
+
80
+```js
81
+const wrapper = mount(Component, {
82
+ slots: {
83
+ default: `<child foo="bar"/><child :foo="val"/>`
84
+ },
85
+ mocks: {
86
+ val: 'qux'
87
88
+ stubs: {
89
+ child: {
90
+ props: {
91
+ foo: {
92
+ type: String,
93
+ required: true
94
+ }
95
96
+ render(h) {
97
+ return h('p', this.foo)
98
99
100
101
+})
102
103
+expect(wrapper.findAll('p').length).toBe(2)
104
+expect(wrapper.text()).toMatch(/bar/)
105
+expect(wrapper.text()).toMatch(/qux/)
106
+```
107
108
## scopedSlots
109
110
- type: `{ [name: string]: string|Function }`
0 commit comments