fix(test_lib): run unit tests in default Documnent

Closes #3501
Fixes #3475
This commit is contained in:
Marc Laval
2015-08-06 12:28:36 +02:00
parent cf6ffd5469
commit a37de36fa6
3 changed files with 5 additions and 7 deletions

View File

@ -138,6 +138,10 @@ export class TestComponentBuilder {
var doc = this._injector.get(DOCUMENT_TOKEN);
// TODO(juliemr): can/should this be optional?
var oldRoots = DOM.querySelectorAll(doc, '[id^=root]');
for (var i = 0; i < oldRoots.length; i++) {
DOM.remove(oldRoots[i]);
}
DOM.appendChild(doc.body, rootEl);

View File

@ -93,7 +93,7 @@ function _getAppBindings() {
// The document is only available in browser environment
try {
appDoc = DOM.createHtmlDocument();
appDoc = DOM.defaultDoc();
} catch (e) {
appDoc = null;
}