File tree 3 files changed +11
-8
lines changed
3 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -116,9 +116,9 @@ The `render` function takes up to 3 parameters and returns an object with some h
116
116
117
117
1 . Component - the Vue component to be tested.
118
118
2 . RenderOptions - an object containing additional information to be passed to @vue/test-utils mount. This can be:
119
- * props - The component props to be passed to TestComponent
120
119
* store - The object definition of a Vuex store, if present ` render ` will configure a Vuex store and pass to mount.
121
120
* routes - A set of routes, if present render will configure VueRouter and pass to mount.
121
+ All additional render options are passed to the vue-test-utils mount function in its options.
122
122
3 . configurationCb - A callback to be called passing the Vue instance when created. This allows 3rd party plugins to be installed prior to mount.
123
123
124
124
### fireEvent
Original file line number Diff line number Diff line change @@ -39,15 +39,18 @@ function render (TestComponent, {
39
39
configurationCb ( localVue )
40
40
}
41
41
42
- const { props, ...rest } = mountOptions
42
+ if ( ! mountOptions . propsData && ! ! mountOptions . props ) {
43
+ mountOptions . propsData = mountOptions . props
44
+ delete mountOptions . props
45
+ }
46
+
43
47
const wrapper = mount ( TestComponent , {
44
48
localVue,
45
49
router,
46
50
store : vuexStore ,
47
- propsData : { ...props } ,
48
51
attachToDocument : true ,
49
52
sync : false ,
50
- ...rest
53
+ ...mountOptions
51
54
} )
52
55
53
56
mountedWrappers . add ( wrapper )
Original file line number Diff line number Diff line change @@ -1873,10 +1873,10 @@ eslint-visitor-keys@^1.0.0:
1873
1873
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d"
1874
1874
integrity sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==
1875
1875
1876
- eslint@^5.11.0 :
1877
- version "5.11.0 "
1878
- resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.11.0 .tgz#51a0e70f137a425fe044cd48273b96f28a774b1f "
1879
- integrity sha512-gbEg0ttToZPkZUv2yYjpipxuYrv/9aSSmgM4V6GkiO3u04QosHYBtduUCqLEulEg3YvNDAkk3OWzyQJ/heZ3Nw ==
1876
+ eslint@^5.11.1 :
1877
+ version "5.11.1 "
1878
+ resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.11.1 .tgz#8deda83db9f354bf9d3f53f9677af7e0e13eadda "
1879
+ integrity sha512-gOKhM8JwlFOc2acbOrkYR05NW8M6DCMSvfcJiBB5NDxRE1gv8kbvxKaC9u69e6ZGEMWXcswA/7eKR229cEIpvg ==
1880
1880
dependencies :
1881
1881
" @babel/code-frame" " ^7.0.0"
1882
1882
ajv "^6.5.3"
You can’t perform that action at this time.
0 commit comments