refactor(core): remove unused attribute utilities from DomAdapters (#32278)

PR Close #32278
This commit is contained in:
Kara Erickson
2019-08-22 16:06:15 -07:00
committed by atscott
parent c3f9893d81
commit 4908a5cffc
5 changed files with 17 additions and 35 deletions

View File

@ -2080,9 +2080,8 @@ function declareTests(config?: {useJit: boolean}) {
TestBed.overrideComponent(SomeCmp, {set: {template}});
const fixture = TestBed.createComponent(SomeCmp);
const useEl = getDOM().firstChild(fixture.nativeElement);
expect(getDOM().getAttributeNS(useEl, 'http://www.w3.org/1999/xlink', 'href'))
.toEqual('#id');
const useEl = getDOM().firstChild(fixture.nativeElement) as Element;
expect(useEl.getAttributeNS('http://www.w3.org/1999/xlink', 'href')).toEqual('#id');
});
it('should support binding to attributes with namespace', () => {
@ -2092,19 +2091,17 @@ function declareTests(config?: {useJit: boolean}) {
const fixture = TestBed.createComponent(SomeCmp);
const cmp = fixture.componentInstance;
const useEl = getDOM().firstChild(fixture.nativeElement);
const useEl = getDOM().firstChild(fixture.nativeElement) as Element;
cmp.value = '#id';
fixture.detectChanges();
expect(getDOM().getAttributeNS(useEl, 'http://www.w3.org/1999/xlink', 'href'))
.toEqual('#id');
expect(useEl.getAttributeNS('http://www.w3.org/1999/xlink', 'href')).toEqual('#id');
cmp.value = null;
fixture.detectChanges();
expect(getDOM().hasAttributeNS(useEl, 'http://www.w3.org/1999/xlink', 'href'))
.toEqual(false);
expect(useEl.hasAttributeNS('http://www.w3.org/1999/xlink', 'href')).toEqual(false);
});
});
}