File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
test/unit/features/options Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -220,6 +220,35 @@ describe('Options provide/inject', () => {
220220 } )
221221 } )
222222
223+ it ( 'should extend properly' , ( ) => {
224+ const parent = Vue . extend ( {
225+ template : `<span/>` ,
226+ inject : [ 'foo' ]
227+ } )
228+
229+ const child = parent . extend ( {
230+ template : `<span/>` ,
231+ inject : [ 'bar' ] ,
232+ created ( ) {
233+ injected = [ this . foo , this . bar ]
234+ }
235+ } )
236+
237+ new Vue ( {
238+ template : `<div><parent/><child/></div>` ,
239+ provide : {
240+ foo : 1 ,
241+ bar : false
242+ } ,
243+ components : {
244+ parent,
245+ child
246+ }
247+ } ) . $mount ( )
248+
249+ expect ( injected ) . toEqual ( [ 1 , false ] )
250+ } )
251+
223252 it ( 'should warn when injections has been modified' , ( ) => {
224253 const key = 'foo'
225254 const vm = new Vue ( {
You can’t perform that action at this time.
0 commit comments