This repository was archived by the owner on Apr 9, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +18
-3
lines changed
Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -85,9 +85,6 @@ describe('NavigationController', () => {
8585 expect ( viewWrapper0 ) . to . have . deep . property ( `style.${ transformPrefix } ` ) ;
8686 expect ( viewWrapper1 ) . to . have . deep . property ( `style.${ transformPrefix } ` ) ;
8787 } ) ;
88- } ) ;
89- describe ( '#componentWillUnmout' , ( ) => {
90-
9188 } ) ;
9289 describe ( '#__transformViews' , ( ) => {
9390 beforeEach ( done => {
@@ -462,6 +459,24 @@ describe('NavigationController', () => {
462459 } ) ;
463460 } )
464461 } ) ;
462+ it ( 'calls lifecycle events' , ( done ) => {
463+ const didShowViewSpy = sinon . spy ( ) ;
464+ const didHideViewSpy = sinon . spy ( ) ;
465+ controller . __pushView ( < ViewB /> , {
466+ transition : Transition . type . NONE
467+ } ) ;
468+ controller . forceUpdate ( ( ) => {
469+ let prevView = controller . refs [ 'view-0' ] ;
470+ let nextView = controller . refs [ 'view-1' ] ;
471+ prevView . navigationControllerDidHideView = didHideViewSpy ;
472+ nextView . navigationControllerDidShowView = didShowViewSpy ;
473+ requestAnimationFrame ( ( ) => {
474+ expect ( didHideViewSpy . calledOnce ) . to . be . true ;
475+ expect ( didShowViewSpy . calledOnce ) . to . be . true ;
476+ done ( ) ;
477+ } ) ;
478+ } ) ;
479+ } ) ;
465480 } ) ;
466481 describe ( '#__popView' , ( ) => {
467482 beforeEach ( done => {
You can’t perform that action at this time.
0 commit comments