@@ -42,7 +42,9 @@ describe('MatIcon', () => {
42
42
let fakePath : string ;
43
43
44
44
beforeEach ( async ( ( ) => {
45
- fakePath = '/fake-path' ;
45
+ // The $ prefix tells Karma not to try to process the
46
+ // request so that we don't get warnings in our logs.
47
+ fakePath = '/$fake-path' ;
46
48
47
49
TestBed . configureTestingModule ( {
48
50
imports : [ HttpClientTestingModule , MatIconModule ] ,
@@ -630,7 +632,7 @@ describe('MatIcon', () => {
630
632
631
633
// We use a regex to match here, rather than the exact value, because different browsers
632
634
// return different quotes through `getAttribute`, while some even omit the quotes altogether.
633
- expect ( circle . getAttribute ( 'filter' ) ) . toMatch ( / ^ u r l \( [ ' " ] ? \/ f a k e - p a t h # b l u r [ ' " ] ? \) $ / ) ;
635
+ expect ( circle . getAttribute ( 'filter' ) ) . toMatch ( / ^ u r l \( [ ' " ] ? \/ \$ f a k e - p a t h # b l u r [ ' " ] ? \) $ / ) ;
634
636
635
637
tick ( ) ;
636
638
} ) ) ;
@@ -651,17 +653,18 @@ describe('MatIcon', () => {
651
653
fixture . detectChanges ( ) ;
652
654
let circle = fixture . nativeElement . querySelector ( 'mat-icon svg circle' ) ;
653
655
654
- expect ( circle . getAttribute ( 'filter' ) ) . toMatch ( / ^ u r l \( [ ' " ] ? \/ f a k e - p a t h # b l u r [ ' " ] ? \) $ / ) ;
656
+ expect ( circle . getAttribute ( 'filter' ) ) . toMatch ( / ^ u r l \( [ ' " ] ? \/ \$ f a k e - p a t h # b l u r [ ' " ] ? \) $ / ) ;
655
657
tick ( ) ;
656
658
fixture . destroy ( ) ;
657
659
658
- fakePath = '/another-fake-path' ;
660
+ fakePath = '/$ another-fake-path' ;
659
661
fixture = TestBed . createComponent ( IconFromSvgName ) ;
660
662
fixture . componentInstance . iconName = 'fido' ;
661
663
fixture . detectChanges ( ) ;
662
664
circle = fixture . nativeElement . querySelector ( 'mat-icon svg circle' ) ;
663
665
664
- expect ( circle . getAttribute ( 'filter' ) ) . toMatch ( / ^ u r l \( [ ' " ] ? \/ a n o t h e r - f a k e - p a t h # b l u r [ ' " ] ? \) $ / ) ;
666
+ expect ( circle . getAttribute ( 'filter' ) )
667
+ . toMatch ( / ^ u r l \( [ ' " ] ? \/ \$ a n o t h e r - f a k e - p a t h # b l u r [ ' " ] ? \) $ / ) ;
665
668
tick ( ) ;
666
669
} ) ) ;
667
670
@@ -683,13 +686,13 @@ describe('MatIcon', () => {
683
686
684
687
// We use a regex to match here, rather than the exact value, because different browsers
685
688
// return different quotes through `getAttribute`, while some even omit the quotes altogether.
686
- expect ( circle . getAttribute ( 'filter' ) ) . toMatch ( / ^ u r l \( [ ' " ] ? \/ f a k e - p a t h # b l u r [ ' " ] ? \) $ / ) ;
689
+ expect ( circle . getAttribute ( 'filter' ) ) . toMatch ( / ^ u r l \( [ ' " ] ? \/ \$ f a k e - p a t h # b l u r [ ' " ] ? \) $ / ) ;
687
690
tick ( ) ;
688
691
689
- fakePath = '/different-path' ;
692
+ fakePath = '/$ different-path' ;
690
693
fixture . detectChanges ( ) ;
691
694
692
- expect ( circle . getAttribute ( 'filter' ) ) . toMatch ( / ^ u r l \( [ ' " ] ? \/ d i f f e r e n t - p a t h # b l u r [ ' " ] ? \) $ / ) ;
695
+ expect ( circle . getAttribute ( 'filter' ) ) . toMatch ( / ^ u r l \( [ ' " ] ? \/ \$ d i f f e r e n t - p a t h # b l u r [ ' " ] ? \) $ / ) ;
693
696
} ) ) ;
694
697
695
698
} ) ;
0 commit comments