refactor(core): remove testing-only childNodes() and firstChild() fns from DomAdapters (#32291)

PR Close #32291
This commit is contained in:
Kara Erickson
2019-08-24 08:01:24 -07:00
committed by Miško Hevery
parent 30dabdf8fc
commit c0680602f9
17 changed files with 45 additions and 53 deletions

View File

@ -95,7 +95,7 @@ export function dispatchEvent(element: any, eventType: any): void {
}
export function el(html: string): HTMLElement {
return <HTMLElement>getDOM().firstChild(getContent(createTemplate(html)));
return <HTMLElement>getContent(createTemplate(html)).firstChild;
}
export function normalizeCSS(css: string): string {
@ -148,7 +148,7 @@ export function stringifyElement(el: any /** TODO #9100 */): string {
// Children
const childrenRoot = templateAwareRoot(el);
const children = childrenRoot ? getDOM().childNodes(childrenRoot) : [];
const children = childrenRoot ? childrenRoot.childNodes : [];
for (let j = 0; j < children.length; j++) {
result += stringifyElement(children[j]);
}

View File

@ -280,7 +280,7 @@ _global.beforeEach(function() {
function elementText(n: any): string {
const hasNodes = (n: any) => {
const children = getDOM().childNodes(n);
const children = n.childNodes;
return children && children.length > 0;
};