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 @@ -4357,7 +4357,7 @@ describe('$compile', function() {
4357
4357
this . $onChanges = onChangesSpy ;
4358
4358
}
4359
4359
} ) ;
4360
- } ) ;
4360
+ } ) ;
4361
4361
4362
4362
inject ( function ( $compile , $rootScope ) {
4363
4363
var template = '<test prop="a" attr="{{a}}"></test>' +
@@ -4377,6 +4377,19 @@ describe('$compile', function() {
4377
4377
prop : jasmine . objectContaining ( { currentValue : NaN } ) ,
4378
4378
attr : jasmine . objectContaining ( { currentValue : 'NaN' } )
4379
4379
} ) ;
4380
+
4381
+ onChangesSpy . calls . reset ( ) ;
4382
+ $rootScope . $apply ( 'a = "bar"; b = 42' ) ;
4383
+
4384
+ expect ( onChangesSpy ) . toHaveBeenCalledTimes ( 2 ) ;
4385
+ expect ( onChangesSpy . calls . argsFor ( 0 ) [ 0 ] ) . toEqual ( {
4386
+ prop : jasmine . objectContaining ( { previousValue : 'foo' , currentValue : 'bar' } ) ,
4387
+ attr : jasmine . objectContaining ( { previousValue : 'foo' , currentValue : 'bar' } )
4388
+ } ) ;
4389
+ expect ( onChangesSpy . calls . argsFor ( 1 ) [ 0 ] ) . toEqual ( {
4390
+ prop : jasmine . objectContaining ( { previousValue : NaN , currentValue : 42 } ) ,
4391
+ attr : jasmine . objectContaining ( { previousValue : 'NaN' , currentValue : '42' } )
4392
+ } ) ;
4380
4393
} ) ;
4381
4394
} ) ;
4382
4395
You can’t perform that action at this time.
0 commit comments