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 +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -4357,7 +4357,7 @@ describe('$compile', function() {
43574357 this . $onChanges = onChangesSpy ;
43584358 }
43594359 } ) ;
4360- } ) ;
4360+ } ) ;
43614361
43624362 inject ( function ( $compile , $rootScope ) {
43634363 var template = '<test prop="a" attr="{{a}}"></test>' +
@@ -4377,6 +4377,19 @@ describe('$compile', function() {
43774377 prop : jasmine . objectContaining ( { currentValue : NaN } ) ,
43784378 attr : jasmine . objectContaining ( { currentValue : 'NaN' } )
43794379 } ) ;
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+ } ) ;
43804393 } ) ;
43814394 } ) ;
43824395
You can’t perform that action at this time.
0 commit comments