@@ -3,6 +3,7 @@ import { compileToFunctions } from 'vue-template-compiler'
3
3
import mount from '~src/mount'
4
4
import ComponentWithProps from '~resources/components/component-with-props.vue'
5
5
import ComponentWithMixin from '~resources/components/component-with-mixin.vue'
6
+ import createLocalVue from '~src/create-local-vue'
6
7
7
8
describe ( 'mount' , ( ) => {
8
9
it ( 'returns new VueWrapper with mounted Vue instance if no options are passed' , ( ) => {
@@ -86,6 +87,48 @@ describe('mount', () => {
86
87
expect ( wrapper . html ( ) ) . to . equal ( `<div>foo</div>` )
87
88
} )
88
89
90
+ it ( 'deletes mounting options before passing options to component' , ( ) => {
91
+ const wrapper = mount ( {
92
+ template : `<div>foo</div>`
93
+ } , {
94
+ provide : {
95
+ 'prop' : 'val'
96
+ } ,
97
+ custom : 'custom' ,
98
+ attachToDocument : 'attachToDocument' ,
99
+ mocks : {
100
+ 'prop' : 'val'
101
+ } ,
102
+ slots : {
103
+ 'prop' : 'val'
104
+ } ,
105
+ localVue : createLocalVue ( ) ,
106
+ stubs : {
107
+ 'prop' : 'val'
108
+ } ,
109
+ clone : 'clone' ,
110
+ attrs : {
111
+ 'prop' : 'val'
112
+ } ,
113
+ listeners : {
114
+ 'prop' : 'val'
115
+ }
116
+ } )
117
+ debugger
118
+ // provide is always a function on an the $options object
119
+ expect ( typeof wrapper . vm . $options . provide ) . to . equal ( 'function' )
120
+ expect ( wrapper . vm . $options . custom ) . to . equal ( undefined )
121
+ expect ( wrapper . vm . $options . attachToDocument ) . to . equal ( undefined )
122
+ expect ( wrapper . vm . $options . mocks ) . to . equal ( undefined )
123
+ expect ( wrapper . vm . $options . slots ) . to . equal ( undefined )
124
+ expect ( wrapper . vm . $options . localVue ) . to . equal ( undefined )
125
+ expect ( wrapper . vm . $options . stubs ) . to . equal ( undefined )
126
+ expect ( wrapper . vm . $options . context ) . to . equal ( undefined )
127
+ expect ( wrapper . vm . $options . clone ) . to . equal ( undefined )
128
+ expect ( wrapper . vm . $options . attrs ) . to . equal ( undefined )
129
+ expect ( wrapper . vm . $options . listeners ) . to . equal ( undefined )
130
+ } )
131
+
89
132
it . skip ( 'throws an error when the component fails to mount' , ( ) => {
90
133
const TestComponent = {
91
134
template : '<div></div>' ,
0 commit comments