Skip to content

Commit b84e365

Browse files
test($resolve): Added test for #1353
This test fails on 0.2.11
1 parent 3fed931 commit b84e365

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/resolveSpec.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,24 @@ describe("resolve", function () {
162162
expect(s.mostRecentCall.args).toEqual([ 'parent', 'grandparent' ]);
163163
}));
164164

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+
165183
it("allows a function to override a parent value of the same name", function () {
166184
var r = $r.resolve({ b: function() { return 'B' } });
167185
var s = $r.resolve({

0 commit comments

Comments
 (0)