@@ -38,7 +38,8 @@ describe('state', function () {
3838 . state ( 'home.item' , { url : "front/:id" } )
3939 . state ( 'about' , { url : "/about" } )
4040 . state ( 'about.person' , { url : "/:person" } )
41- . state ( 'about.person.item' , { url : "/:id" } ) ;
41+ . state ( 'about.person.item' , { url : "/:id" } )
42+ . state ( 'about.sidebar' , { } ) ;
4243
4344 $provide . value ( 'AppInjectable' , AppInjectable ) ;
4445 } ) ) ;
@@ -160,7 +161,7 @@ describe('state', function () {
160161 '$stateChangeSuccess(C,A);' ) ;
161162 } ) ) ;
162163
163- it ( 'aborts pending transitions even when going back to the curren state' , inject ( function ( $state , $q ) {
164+ it ( 'aborts pending transitions even when going back to the current state' , inject ( function ( $state , $q ) {
164165 initStateTo ( A ) ;
165166 logEvents = true ;
166167
@@ -191,6 +192,11 @@ describe('state', function () {
191192 'D.onExit;' +
192193 'A.onEnter;' ) ;
193194 } ) ) ;
195+
196+ it ( 'doesn\'t transition to parent state when child has no URL' , inject ( function ( $state , $q ) {
197+ $state . transitionTo ( 'about.sidebar' ) ; $q . flush ( ) ;
198+ expect ( $state . current . name ) . toEqual ( 'about.sidebar' ) ;
199+ } ) ) ;
194200 } ) ;
195201
196202
0 commit comments