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 {
378
378
private _toSvgElement ( element : Element ) : SVGElement {
379
379
let svg = this . _svgElementFromString ( '<svg></svg>' ) ;
380
380
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 ) ) ;
383
383
}
384
384
385
385
return svg ;
Original file line number Diff line number Diff line change @@ -254,12 +254,11 @@ describe('MdIcon', () => {
254
254
fixture . detectChanges ( ) ;
255
255
256
256
const svgElement = verifyAndGetSingleSvgChild ( mdIconElement ) ;
257
- const firstChild = svgElement . children [ 0 ] ;
257
+ const path = svgElement . querySelector ( 'path' ) ;
258
258
259
259
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' ) ;
263
262
} ) ;
264
263
265
264
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