@@ -22,14 +22,11 @@ describe('ComponentElement class', () => {
22
22
} ,
23
23
render ( h ) {
24
24
return ( this . child = h ( 'comp' , { props : { value : this . value , prop1 : this . prop1 } } ) )
25
- } ,
26
- methods : {
27
- _validatorProps ( ) {
28
- return [ 'value' , 'prop1' ]
29
- }
30
25
}
31
26
} ) . $mount ( )
32
27
const component = new ComponentElement ( vm , vm . child )
28
+ // set stup
29
+ component . _validatorProps = ( ) => { return [ 'value' , 'prop1' ] }
33
30
assert . deepEqual ( component . getValue ( ) , { value : 'hello' , prop1 : 'foo' } )
34
31
waitForUpdate ( ( ) => {
35
32
vm . value = 'world'
@@ -60,14 +57,9 @@ describe('ComponentElement class', () => {
60
57
} ,
61
58
render ( h ) {
62
59
return ( this . child = h ( 'comp' , { props : { value : this . value , prop1 : this . prop1 } } ) )
63
- } ,
64
- methods : {
65
- _validatorProps ( ) {
66
- return [ 'value' , 'prop1' ]
67
- }
68
60
}
69
61
} ) . $mount ( )
70
- const component = new ComponentElement ( vm , vm . child )
62
+ const component = new ComponentElement ( vm , vm . child , ( ) => [ 'value' , 'prop1' ] )
71
63
assert ( component . checkModified ( ) === false )
72
64
waitForUpdate ( ( ) => {
73
65
vm . value = 'world'
@@ -86,7 +78,6 @@ describe('ComponentElement class', () => {
86
78
describe ( '#listenToucheableEvent / #unlistenToucheableEvent' , ( ) => {
87
79
it ( 'should be work' , done => {
88
80
const handleFocusout = jasmine . createSpy ( )
89
- const _validatorProps = function ( ) { return [ 'value' , 'prop1' ] }
90
81
const vm = new Vue ( {
91
82
data : {
92
83
child : null ,
@@ -104,11 +95,12 @@ describe('ComponentElement class', () => {
104
95
return ( this . child = h ( 'comp' , { props : { value : this . value } } ) )
105
96
} ,
106
97
methods : {
107
- willUpdateTouched : handleFocusout ,
108
- _validatorProps
98
+ willUpdateTouched : handleFocusout
109
99
}
110
100
} ) . $mount ( )
111
101
const component = new ComponentElement ( vm , vm . child )
102
+ // set stup
103
+ component . _validatorProps = ( ) => { return [ 'value' , 'prop1' ] }
112
104
component . listenToucheableEvent ( )
113
105
triggerEvent ( vm . $el , 'focusout' )
114
106
waitForUpdate ( ( ) => {
@@ -126,7 +118,6 @@ describe('ComponentElement class', () => {
126
118
describe ( 'component' , ( ) => {
127
119
it ( 'should be work' , done => {
128
120
const watchInputable = jasmine . createSpy ( )
129
- const _validatorProps = function ( ) { return [ 'value' , 'prop1' ] }
130
121
const vm = new Vue ( {
131
122
data : {
132
123
child : null ,
@@ -144,9 +135,11 @@ describe('ComponentElement class', () => {
144
135
render ( h ) {
145
136
return ( this . child = h ( 'comp' , { props : { value : this . value , prop1 : this . prop1 } } ) )
146
137
} ,
147
- methods : { watchInputable, _validatorProps }
138
+ methods : { watchInputable }
148
139
} ) . $mount ( )
149
140
const component = new ComponentElement ( vm , vm . child )
141
+ // set stup
142
+ component . _validatorProps = ( ) => { return [ 'value' , 'prop1' ] }
150
143
component . listenInputableEvent ( )
151
144
waitForUpdate ( ( ) => {
152
145
vm . value = 'world'
0 commit comments