Mock the MdIconRegistry from Angular Material to return SVG DOM Node.
//
// Mock an SVG DOM Node
//
const svg = `<svg xmlns="http://www.w3.org/2000/svg" width="1" height="1" viewBox="0 0 1 1"><path id="testPath"></path></svg>`;
const parser = new DOMParser();
const svgDocument = parser.parseFromString(svg, 'image/svg+xml');
//
// Mock the icon registry which will return our SVG node
//
class MdIconRegistryMock {
constructor() {}
getNamedSvgIcon = jasmine.createSpy('getNamedSvgIcon').and
.returnValue(Observable.of(svgDocument.documentElement));
getDefaultFontSetClass = jasmine.createSpy('getDefaultFontSetClass').and
.returnValue('material-icons');
}