Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/vue-testing-library/api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,22 @@ Vue Router is passed, it will be used.

It will be merged with `propsData`.

##### `slots` (`Object`)

Used to provide slot content when rendering the component. Keys are slot names,
and values can be strings, template snippets, or components, similar to how
[slots](https://test-utils.vuejs.org/api/#slots) are defined in Vue Test Utils.

For example:

```js
render(MyComponent, {
slots: {
default: 'default content',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also add an example with a named slot here please?
I think this would make it clearer

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure! I’ve updated the PR with an example for a named slot as requested.
The example is based on the documentation from https://test-utils.vuejs.org/api/#slots.

},
})
```

##### `container` (`HTMLElement`)

By default, `Vue Testing Library` will create a `div` and append it to the
Expand Down