File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -52,9 +52,10 @@ describe('Instance Scope', function () {
5252 expect ( vm . c ) . toBe ( 1 )
5353 } )
5454
55- it ( 'prop should overwrite default value' , function ( ) {
55+ it ( 'external prop should overwrite default value' , function ( ) {
5656 var el = document . createElement ( 'div' )
5757 el . setAttribute ( 'c' , '2' )
58+ el . textContent = '{{c}}'
5859 var vm = new Vue ( {
5960 el : el ,
6061 props : [ 'c' ] ,
@@ -63,6 +64,7 @@ describe('Instance Scope', function () {
6364 }
6465 } )
6566 expect ( vm . c ) . toBe ( 2 )
67+ expect ( el . textContent ) . toBe ( '2' )
6668 } )
6769
6870 it ( 'props should be available in data() and create()' , function ( ) {
@@ -74,12 +76,16 @@ describe('Instance Scope', function () {
7476 data : function ( ) {
7577 expect ( this . c ) . toBe ( 2 )
7678 expect ( this . _data . c ) . toBe ( 2 )
79+ return {
80+ d : this . c + 1
81+ }
7782 } ,
7883 created : function ( ) {
7984 expect ( this . c ) . toBe ( 2 )
8085 expect ( this . _data . c ) . toBe ( 2 )
8186 }
8287 } )
88+ expect ( vm . d ) . toBe ( 3 )
8389 } )
8490
8591 it ( 'replace $data' , function ( ) {
You can’t perform that action at this time.
0 commit comments