Skip to content

Commit 10337b9

Browse files
author
Vaibhav Singh
authored
feat: add props in mountComponent (#4)
1 parent 348afb8 commit 10337b9

File tree

5 files changed

+551
-166
lines changed

5 files changed

+551
-166
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ writing Vue component tests.
9595
**Parameters:**
9696
- `componentPath` – location of the component file (`.jsx`) to be mounted
9797
- `options` – this can include:
98+
- `props` - properties to be passed to the Vue component, this will be serialized to JSON
9899
- `plugins`: if needed, a store (VueX or Pinia) and a router can be loaded together with the component
99100
- `mocks`: this can be a list of url calls that can be mocked (will be passed to [sinon](https://sinonjs.org/) automatically); at the moment only [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) calls can be mocked, but XHR support will be added soon.
100101
- `callback` – an optional callback function which will be called with the component element
@@ -105,6 +106,14 @@ writing Vue component tests.
105106
const component = await browser.mountComponent('/src/components/Form.vue')
106107
```
107108

109+
```js
110+
const component = await browser.mountComponent('/src/components/Welcome.vue', {
111+
props: {
112+
username: 'John Doe'
113+
}
114+
})
115+
```
116+
108117
```js
109118
const component = await browser.mountComponent('/src/components/Form.vue', {
110119
plugins: {

0 commit comments

Comments
 (0)