@@ -223,27 +223,25 @@ describe('uiView', function () {
223
223
expect ( $anchorScroll ) . not . toHaveBeenCalled ( ) ;
224
224
} ) ) ;
225
225
226
- it ( 'should autoscroll when expr is missing' , inject ( function ( $state , $q , $anchorScroll ) {
226
+ it ( 'should autoscroll when expression is missing' , inject ( function ( $state , $q , $anchorScroll ) {
227
227
elem . append ( $compile ( '<div ui-view autoscroll></div>' ) ( scope ) ) ;
228
228
$state . transitionTo ( gState ) ;
229
229
$q . flush ( ) ;
230
230
expect ( $anchorScroll ) . toHaveBeenCalled ( ) ;
231
231
} ) ) ;
232
232
233
- it ( 'should autoscroll when expression is truthy' , inject ( function ( $state , $q , $anchorScroll ) {
234
- elem . append ( $compile ( '<div ui-view autoscroll="doAutoScroll"></div>' ) ( scope ) ) ;
235
- scope . doAutoScroll = true ;
236
- $state . transitionTo ( gState ) ;
237
- $q . flush ( ) ;
238
- expect ( $anchorScroll ) . toHaveBeenCalled ( ) ;
239
- } ) ) ;
233
+ it ( 'should autoscroll based on expression' , inject ( function ( $state , $q , $anchorScroll ) {
234
+ elem . append ( $compile ( '<div ui-view autoscroll="doScroll"></div>' ) ( scope ) ) ;
240
235
241
- it ( 'should not autoscroll when expression is falsy' , inject ( function ( $state , $q , $anchorScroll ) {
242
- elem . append ( $compile ( '<div ui-view autoscroll="doAutoScroll()"></div>' ) ( scope ) ) ;
243
- scope . doAutoScroll = function ( ) { return false ; } ;
244
- $state . transitionTo ( gState ) ;
236
+ scope . doScroll = false ;
237
+ $state . transitionTo ( aState ) ;
245
238
$q . flush ( ) ;
246
239
expect ( $anchorScroll ) . not . toHaveBeenCalled ( ) ;
240
+
241
+ scope . doScroll = true ;
242
+ $state . transitionTo ( bState ) ;
243
+ $q . flush ( ) ;
244
+ expect ( $anchorScroll ) . toHaveBeenCalled ( ) ;
247
245
} ) ) ;
248
246
} ) ;
249
247
0 commit comments