File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -378,8 +378,8 @@ export class MdIconRegistry {
378378 private _toSvgElement ( element : Element ) : SVGElement {
379379 let svg = this . _svgElementFromString ( '<svg></svg>' ) ;
380380
381- for ( let i = 0 ; i < element . children . length ; i ++ ) {
382- svg . appendChild ( element . children [ i ] . cloneNode ( true ) ) ;
381+ for ( let i = 0 ; i < element . childNodes . length ; i ++ ) {
382+ svg . appendChild ( element . childNodes [ i ] . cloneNode ( true ) ) ;
383383 }
384384
385385 return svg ;
Original file line number Diff line number Diff line change @@ -254,12 +254,11 @@ describe('MdIcon', () => {
254254 fixture . detectChanges ( ) ;
255255
256256 const svgElement = verifyAndGetSingleSvgChild ( mdIconElement ) ;
257- const firstChild = svgElement . children [ 0 ] ;
257+ const path = svgElement . querySelector ( 'path' ) ;
258258
259259 expect ( svgElement . querySelector ( 'symbol' ) ) . toBeFalsy ( ) ;
260- expect ( svgElement . children . length ) . toBe ( 1 ) ;
261- expect ( firstChild . nodeName . toLowerCase ( ) ) . toBe ( 'path' ) ;
262- expect ( firstChild . getAttribute ( 'id' ) ) . toBe ( 'quack' ) ;
260+ expect ( path ) . toBeTruthy ( ) ;
261+ expect ( path . getAttribute ( 'id' ) ) . toBe ( 'quack' ) ;
263262 } ) ;
264263
265264 it ( 'should not wrap <svg> elements in icon sets in another svg tag' , ( ) => {
You can’t perform that action at this time.
0 commit comments