@@ -11,16 +11,21 @@ describe('UNIT: Transition', function () {
1111
1212 it ( 'should skip if compiler is in init stage' , function ( ) {
1313 var c = mockChange ( ) ,
14- code = transition ( null , 1 , c . change , { init : true } )
14+ compiler = mockCompiler ( )
15+ compiler . init = true
16+ var code = transition ( null , 1 , c . change , compiler )
1517 assert . ok ( c . called )
1618 assert . strictEqual ( code , codes . INIT )
19+ assert . ok ( compiler . enteredView )
1720 } )
1821
1922 it ( 'should skip if no transition is found on the node' , function ( ) {
2023 var c = mockChange ( ) ,
21- code = transition ( mockEl ( ) , 1 , c . change , { } )
24+ compiler = mockCompiler ( ) ,
25+ code = transition ( mockEl ( ) , 1 , c . change , compiler )
2226 assert . ok ( c . called )
2327 assert . strictEqual ( code , codes . SKIP )
28+ assert . ok ( compiler . enteredView )
2429 } )
2530
2631 } )
@@ -31,9 +36,11 @@ describe('UNIT: Transition', function () {
3136
3237 it ( 'should skip if transition is not available' , function ( ) {
3338 var c = mockChange ( ) ,
34- code = transition ( mockEl ( 'css' ) , 1 , c . change , { } )
39+ compiler = mockCompiler ( ) ,
40+ code = transition ( mockEl ( 'css' ) , 1 , c . change , compiler )
3541 assert . ok ( c . called )
3642 assert . strictEqual ( code , codes . CSS_SKIP )
43+ assert . ok ( compiler . enteredView )
3744 } )
3845
3946 // skip the rest
@@ -130,21 +137,27 @@ describe('UNIT: Transition', function () {
130137
131138 it ( 'should skip if correspinding option is not defined' , function ( ) {
132139 var c = mockChange ( ) ,
133- code = transition ( mockEl ( 'js' ) , 1 , c . change , mockCompiler ( ) )
140+ compiler = mockCompiler ( ) ,
141+ code = transition ( mockEl ( 'js' ) , 1 , c . change , compiler )
134142 assert . ok ( c . called )
135143 assert . strictEqual ( code , codes . JS_SKIP )
144+ assert . ok ( compiler . enteredView )
136145 } )
137146
138147 it ( 'should skip if the option is given but the enter/leave func is not defined' , function ( ) {
139148 var c = mockChange ( ) ,
140- code = transition ( mockEl ( 'js' ) , 1 , c . change , mockCompiler ( { } ) )
149+ compiler = mockCompiler ( { } ) ,
150+ code = transition ( mockEl ( 'js' ) , 1 , c . change , compiler )
141151 assert . ok ( c . called )
142152 assert . strictEqual ( code , codes . JS_SKIP_E )
153+ assert . ok ( compiler . enteredView )
143154
144155 c = mockChange ( )
145- code = transition ( mockEl ( 'js' ) , - 1 , c . change , mockCompiler ( { } ) )
156+ compiler = mockCompiler ( { } )
157+ code = transition ( mockEl ( 'js' ) , - 1 , c . change , compiler )
146158 assert . ok ( c . called )
147159 assert . strictEqual ( code , codes . JS_SKIP_L )
160+ assert . ok ( compiler . leftView )
148161 } )
149162
150163 describe ( 'enter' , function ( ) {
0 commit comments