@@ -621,10 +621,8 @@ describe('form animations', function() {
621
621
it ( 'should trigger an animation when invalid' , inject ( function ( $animate ) {
622
622
form . $setValidity ( 'required' , false ) ;
623
623
624
- assertValidAnimation ( $animate . queue [ 0 ] , 'removeClass' , 'ng-valid' ) ;
625
- assertValidAnimation ( $animate . queue [ 1 ] , 'addClass' , 'ng-invalid' ) ;
626
- assertValidAnimation ( $animate . queue [ 2 ] , 'removeClass' , 'ng-valid-required' ) ;
627
- assertValidAnimation ( $animate . queue [ 3 ] , 'addClass' , 'ng-invalid-required' ) ;
624
+ assertValidAnimation ( $animate . queue [ 0 ] , 'setClass' , 'ng-invalid' , 'ng-valid' ) ;
625
+ assertValidAnimation ( $animate . queue [ 1 ] , 'setClass' , 'ng-invalid-required' , 'ng-valid-required' ) ;
628
626
} ) ) ;
629
627
630
628
it ( 'should trigger an animation when valid' , inject ( function ( $animate ) {
@@ -634,10 +632,8 @@ describe('form animations', function() {
634
632
635
633
form . $setValidity ( 'required' , true ) ;
636
634
637
- assertValidAnimation ( $animate . queue [ 0 ] , 'removeClass' , 'ng-invalid' ) ;
638
- assertValidAnimation ( $animate . queue [ 1 ] , 'addClass' , 'ng-valid' ) ;
639
- assertValidAnimation ( $animate . queue [ 2 ] , 'removeClass' , 'ng-invalid-required' ) ;
640
- assertValidAnimation ( $animate . queue [ 3 ] , 'addClass' , 'ng-valid-required' ) ;
635
+ assertValidAnimation ( $animate . queue [ 0 ] , 'setClass' , 'ng-valid' , 'ng-invalid' ) ;
636
+ assertValidAnimation ( $animate . queue [ 1 ] , 'setClass' , 'ng-valid-required' , 'ng-invalid-required' ) ;
641
637
} ) ) ;
642
638
643
639
it ( 'should trigger an animation when dirty' , inject ( function ( $animate ) {
@@ -661,17 +657,13 @@ describe('form animations', function() {
661
657
it ( 'should trigger custom errors as addClass/removeClass when invalid/valid' , inject ( function ( $animate ) {
662
658
form . $setValidity ( 'custom-error' , false ) ;
663
659
664
- assertValidAnimation ( $animate . queue [ 0 ] , 'removeClass' , 'ng-valid' ) ;
665
- assertValidAnimation ( $animate . queue [ 1 ] , 'addClass' , 'ng-invalid' ) ;
666
- assertValidAnimation ( $animate . queue [ 2 ] , 'removeClass' , 'ng-valid-custom-error' ) ;
667
- assertValidAnimation ( $animate . queue [ 3 ] , 'addClass' , 'ng-invalid-custom-error' ) ;
660
+ assertValidAnimation ( $animate . queue [ 0 ] , 'setClass' , 'ng-invalid' , 'ng-valid' ) ;
661
+ assertValidAnimation ( $animate . queue [ 1 ] , 'setClass' , 'ng-invalid-custom-error' , 'ng-valid-custom-error' ) ;
668
662
669
663
$animate . queue = [ ] ;
670
664
form . $setValidity ( 'custom-error' , true ) ;
671
665
672
- assertValidAnimation ( $animate . queue [ 0 ] , 'removeClass' , 'ng-invalid' ) ;
673
- assertValidAnimation ( $animate . queue [ 1 ] , 'addClass' , 'ng-valid' ) ;
674
- assertValidAnimation ( $animate . queue [ 2 ] , 'removeClass' , 'ng-invalid-custom-error' ) ;
675
- assertValidAnimation ( $animate . queue [ 3 ] , 'addClass' , 'ng-valid-custom-error' ) ;
666
+ assertValidAnimation ( $animate . queue [ 0 ] , 'setClass' , 'ng-valid' , 'ng-invalid' ) ;
667
+ assertValidAnimation ( $animate . queue [ 1 ] , 'setClass' , 'ng-valid-custom-error' , 'ng-invalid-custom-error' ) ;
676
668
} ) ) ;
677
669
} ) ;
0 commit comments