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 () {
52
52
expect ( vm . c ) . toBe ( 1 )
53
53
} )
54
54
55
- it ( 'prop should overwrite default value' , function ( ) {
55
+ it ( 'external prop should overwrite default value' , function ( ) {
56
56
var el = document . createElement ( 'div' )
57
57
el . setAttribute ( 'c' , '2' )
58
+ el . textContent = '{{c}}'
58
59
var vm = new Vue ( {
59
60
el : el ,
60
61
props : [ 'c' ] ,
@@ -63,6 +64,7 @@ describe('Instance Scope', function () {
63
64
}
64
65
} )
65
66
expect ( vm . c ) . toBe ( 2 )
67
+ expect ( el . textContent ) . toBe ( '2' )
66
68
} )
67
69
68
70
it ( 'props should be available in data() and create()' , function ( ) {
@@ -74,12 +76,16 @@ describe('Instance Scope', function () {
74
76
data : function ( ) {
75
77
expect ( this . c ) . toBe ( 2 )
76
78
expect ( this . _data . c ) . toBe ( 2 )
79
+ return {
80
+ d : this . c + 1
81
+ }
77
82
} ,
78
83
created : function ( ) {
79
84
expect ( this . c ) . toBe ( 2 )
80
85
expect ( this . _data . c ) . toBe ( 2 )
81
86
}
82
87
} )
88
+ expect ( vm . d ) . toBe ( 3 )
83
89
} )
84
90
85
91
it ( 'replace $data' , function ( ) {
You can’t perform that action at this time.
0 commit comments