File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -162,6 +162,24 @@ describe("resolve", function () {
162
162
expect ( s . mostRecentCall . args ) . toEqual ( [ 'parent' , 'grandparent' ] ) ;
163
163
} ) ) ;
164
164
165
+ // test for #1353
166
+ it ( "allow parent resolve to override grandparent resolve" , inject ( function ( $q ) {
167
+ var gPromise = $q . defer ( ) ,
168
+ gInjectable = jasmine . createSpy ( 'gInjectable' ) . andReturn ( gPromise . promise ) ;
169
+
170
+ var g = $r . resolve ( { item : [ function ( ) { return "grandparent" ; } ] } , g ) ;
171
+ gPromise . resolve ( 'grandparent' ) ;
172
+ tick ( ) ;
173
+
174
+ var p = $r . resolve ( { item : [ function ( ) { return "parent" ; } ] } , { } , g ) ;
175
+ var s = jasmine . createSpy ( 's' ) ;
176
+ var c = $r . resolve ( { c : [ s ] } , { } , p ) ;
177
+ tick ( ) ;
178
+
179
+ expect ( s ) . toHaveBeenCalled ( ) ;
180
+ expect ( c . $$values . item ) . toBe ( 'parent' ) ;
181
+ } ) ) ;
182
+
165
183
it ( "allows a function to override a parent value of the same name" , function ( ) {
166
184
var r = $r . resolve ( { b : function ( ) { return 'B' } } ) ;
167
185
var s = $r . resolve ( {
You can’t perform that action at this time.
0 commit comments