fix(test_lib): run unit tests in default Documnent
Closes #3501 Fixes #3475
This commit is contained in:
@ -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);
|
||||
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user