cleanup(element_injector): added a missing test
This commit is contained in:
parent
bda120d862
commit
b5c9f9ed9b
|
@ -1,7 +1,8 @@
|
||||||
import {describe, ddescribe, it, iit, xit, xdescribe, expect, beforeEach, SpyObject, proxy, el} from 'angular2/test_lib';
|
import {describe, ddescribe, it, iit, xit, xdescribe, expect, beforeEach, SpyObject, proxy, el} from 'angular2/test_lib';
|
||||||
import {isBlank, isPresent, IMPLEMENTS} from 'angular2/src/facade/lang';
|
import {isBlank, isPresent, IMPLEMENTS} from 'angular2/src/facade/lang';
|
||||||
import {ListWrapper, MapWrapper, List, StringMapWrapper, iterateListLike} from 'angular2/src/facade/collection';
|
import {ListWrapper, MapWrapper, List, StringMapWrapper, iterateListLike} from 'angular2/src/facade/collection';
|
||||||
import {ProtoElementInjector, PreBuiltObjects, DirectiveBinding, TreeNode} from 'angular2/src/core/compiler/element_injector';
|
import {ProtoElementInjector, PreBuiltObjects, DirectiveBinding, TreeNode, ElementRef}
|
||||||
|
from 'angular2/src/core/compiler/element_injector';
|
||||||
import {Parent, Ancestor} from 'angular2/src/core/annotations/visibility';
|
import {Parent, Ancestor} from 'angular2/src/core/annotations/visibility';
|
||||||
import {EventEmitter, PropertySetter, Attribute, Query} from 'angular2/src/core/annotations/di';
|
import {EventEmitter, PropertySetter, Attribute, Query} from 'angular2/src/core/annotations/di';
|
||||||
import {onDestroy} from 'angular2/src/core/annotations/annotations';
|
import {onDestroy} from 'angular2/src/core/annotations/annotations';
|
||||||
|
@ -169,6 +170,13 @@ class NeedsQuery {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class NeedsElementRef {
|
||||||
|
elementRef;
|
||||||
|
constructor(ref:ElementRef) {
|
||||||
|
this.elementRef = ref;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class A_Needs_B {
|
class A_Needs_B {
|
||||||
constructor(dep){}
|
constructor(dep){}
|
||||||
}
|
}
|
||||||
|
@ -802,6 +810,13 @@ export function main() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe("ElementRef", () => {
|
||||||
|
it("should inject ElementRef", () => {
|
||||||
|
var inj = injector([NeedsElementRef]);
|
||||||
|
expect(inj.get(NeedsElementRef).elementRef).toBeAnInstanceOf(ElementRef);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe('directive queries', () => {
|
describe('directive queries', () => {
|
||||||
var preBuildObjects = defaultPreBuiltObjects;
|
var preBuildObjects = defaultPreBuiltObjects;
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|
Loading…
Reference in New Issue