This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -410,16 +410,20 @@ describe('ngClass', function() {
410
410
expect ( e2 . hasClass ( 'odd' ) ) . toBeFalsy ( ) ;
411
411
} ) ) ;
412
412
413
- it ( 'should support changing multiple classes via variable array mixed with conditionally via a map' , inject ( function ( $rootScope , $compile ) {
414
- $rootScope . classVar = [ '' , { orange : true } ] ;
415
- element = $compile ( '<div class="existing" ng-class="classVar"></div>' ) ( $rootScope ) ;
416
- $rootScope . $digest ( ) ;
413
+ it ( 'should support mixed array/object variable with a mutating object' ,
414
+ inject ( function ( $rootScope , $compile ) {
415
+ element = $compile ( '<div ng-class="classVar"></div>' ) ( $rootScope ) ;
417
416
418
- $rootScope . classVar [ 1 ] . orange = false ;
419
- $rootScope . $digest ( ) ;
417
+ $rootScope . classVar = [ { orange : true } ] ;
418
+ $rootScope . $digest ( ) ;
419
+ expect ( element ) . toHaveClass ( 'orange' ) ;
420
420
421
- expect ( element . hasClass ( 'orange' ) ) . toBeFalsy ( ) ;
422
- } ) ) ;
421
+ $rootScope . classVar [ 0 ] . orange = false ;
422
+ $rootScope . $digest ( ) ;
423
+
424
+ expect ( element ) . not . toHaveClass ( 'orange' ) ;
425
+ } )
426
+ ) ;
423
427
424
428
} ) ;
425
429
You can’t perform that action at this time.
0 commit comments