This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree 1 file changed +14
-1
lines changed
1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -4397,7 +4397,7 @@ describe('$compile', function() {
4397
4397
this . $onChanges = onChangesSpy ;
4398
4398
}
4399
4399
} ) ;
4400
- } ) ;
4400
+ } ) ;
4401
4401
4402
4402
inject ( function ( $compile , $rootScope ) {
4403
4403
var template = '<test prop="a" attr="{{a}}"></test>' +
@@ -4417,6 +4417,19 @@ describe('$compile', function() {
4417
4417
prop : jasmine . objectContaining ( { currentValue : NaN } ) ,
4418
4418
attr : jasmine . objectContaining ( { currentValue : 'NaN' } )
4419
4419
} ) ;
4420
+
4421
+ onChangesSpy . calls . reset ( ) ;
4422
+ $rootScope . $apply ( 'a = "bar"; b = 42' ) ;
4423
+
4424
+ expect ( onChangesSpy ) . toHaveBeenCalledTimes ( 2 ) ;
4425
+ expect ( onChangesSpy . calls . argsFor ( 0 ) [ 0 ] ) . toEqual ( {
4426
+ prop : jasmine . objectContaining ( { previousValue : 'foo' , currentValue : 'bar' } ) ,
4427
+ attr : jasmine . objectContaining ( { previousValue : 'foo' , currentValue : 'bar' } )
4428
+ } ) ;
4429
+ expect ( onChangesSpy . calls . argsFor ( 1 ) [ 0 ] ) . toEqual ( {
4430
+ prop : jasmine . objectContaining ( { previousValue : NaN , currentValue : 42 } ) ,
4431
+ attr : jasmine . objectContaining ( { previousValue : 'NaN' , currentValue : '42' } )
4432
+ } ) ;
4420
4433
} ) ;
4421
4434
} ) ;
4422
4435
You can’t perform that action at this time.
0 commit comments