作者:AnthonyPAlice
项目:angula
findTestabilityInTree(registry: TestabilityRegistry, elem: any, findInAncestors: boolean):
Testability|null {
if (elem == null) {
return null;
}
const t = registry.getTestability(elem);
if (t != null) {
return t;
} else if (!findInAncestors) {
return null;
}
if (getDOM().isShadowRoot(elem)) {
return this.findTestabilityInTree(registry, getDOM().getHost(elem), true);
}
return this.findTestabilityInTree(registry, getDOM().parentElement(elem), true);
}
作者:AnthonyPAlice
项目:angula
global['getAngularTestability'] = (elem: any, findInAncestors: boolean = true) => {
const testability = registry.findTestabilityInTree(elem, findInAncestors);
if (testability == null) {
throw new Error('Could not find testability for element.');
}
return testability;
};
作者:Coco-wa
项目:angula
global.getAngularTestability = (elem: any, findInAncestors: boolean = true) => {
var testability = registry.findTestabilityInTree(elem, findInAncestors);
if (testability == null) {
throw new Error('Could not find testability for element.');
}
return new PublicTestability(testability);
};
作者:AnthonyPAlice
项目:angula
global['getAllAngularRootElements'] = () => registry.getAllRootElements();
作者:Coco-wa
项目:angula
global.getAllAngularRootElements = () => registry.getAllRootElements();
作者:Coco-wa
项目:angula
global.getAllAngularTestabilities = () => {
var testabilities = registry.getAllTestabilities();
return testabilities.map((testability) => { return new PublicTestability(testability); });
};
作者:AlmogShau
项目:angula
global.getAllAngularTestabilities = () => registry.getAllTestabilities();
作者:JanStureNielse
项目:angula
global.getAllAngularTestabilities = () => { return registry.getAllTestabilities(); };