Edit:
This is a known bug: https://github.com/angular/angular/issues/15164
By.css() cannot select instances of SVGElement.
SVG DOMElement.querySelector.
it('Should create new svg element', async(()=>{
fixture.whenStable().then(() => {
const nativeElement = de.nativeElement;
fixture.detectChanges();
expect(nativeElement.querySelector('svg')).toBeTruthy();
});
}));
plunker: https://embed.plnkr.co/bgH31O/
:
ng-inline-svg, , , <svg> DOM ?
, whenStable():
it('Should create new svg element', async(()=>{
fixture.whenStable().then(() => {
fixture.detectChanges();
expect(de.query(By.css('svg'))).toBeTruthy();
});
}));
whenStable , - "stable".