refactor(testability): rename function to get testability
Previously, getting testability was `window.angular2.getTestability` This was because the plan was to export the API to the window as angular2. However, the decision was changed to make this just `angular` in https://github.com/angular/angular/commit/3177576ad6889fd7cb592d27ff0cd5c0d85bd9d6 To decouple testability from the rest of the Angular API, just make it one function, `window.getAngularTestability`.
This commit is contained in:
@@ -85,12 +85,9 @@ class PublicTestability implements _JsObjectProxyable {
|
||||
|
||||
class GetTestability {
|
||||
static addToWindow(TestabilityRegistry registry) {
|
||||
js.context['angular2'] = _jsify({
|
||||
'getTestability': (Element elem) {
|
||||
js.context['getAngularTestability'] = _jsify((Element elem) {
|
||||
Testability testability = registry.findTestabilityInTree(elem);
|
||||
return _jsify(new PublicTestability(testability));
|
||||
},
|
||||
'resumeBootstrap': ([arg]) {},
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,10 +19,7 @@ class PublicTestability {
|
||||
|
||||
export class GetTestability {
|
||||
static addToWindow(registry: TestabilityRegistry) {
|
||||
if (!global.angular2) {
|
||||
global.angular2 = {};
|
||||
}
|
||||
global.angular2.getTestability = function(elem): PublicTestability {
|
||||
global.getAngularTestability = function(elem): PublicTestability {
|
||||
var testability = registry.findTestabilityInTree(elem);
|
||||
|
||||
if (testability == null) {
|
||||
@@ -30,9 +27,5 @@ export class GetTestability {
|
||||
}
|
||||
return new PublicTestability(testability);
|
||||
};
|
||||
global.angular2.resumeBootstrap = function() {
|
||||
// Intentionally left blank. This will allow Protractor to run
|
||||
// against angular2 without turning off Angular synchronization.
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user