Skip to content

Commit 14cb9fb

Browse files
test(docs-infra): add mocks for missing mat-icons (#47469)
add mocks for missing mat-icons in order to reduce noise when running aio tests PR Close #47469
1 parent adb1a61 commit 14cb9fb

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

aio/src/app/custom-elements/search/file-not-found-search.component.spec.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@ import { SearchResults } from 'app/search/interfaces';
77
import { SearchResultsComponent } from 'app/shared/search-results/search-results.component';
88
import { SearchService } from 'app/search/search.service';
99
import { FileNotFoundSearchComponent } from './file-not-found-search.component';
10+
import { Component } from '@angular/core';
1011

12+
@Component({
13+
selector: 'mat-icon',
14+
template: '',
15+
})
16+
class MockMatIcon {}
1117

1218
describe('FileNotFoundSearchComponent', () => {
1319
let fixture: ComponentFixture<FileNotFoundSearchComponent>;
@@ -17,7 +23,7 @@ describe('FileNotFoundSearchComponent', () => {
1723
beforeEach(() => {
1824

1925
TestBed.configureTestingModule({
20-
declarations: [ FileNotFoundSearchComponent, SearchResultsComponent ],
26+
declarations: [ FileNotFoundSearchComponent, SearchResultsComponent, MockMatIcon ],
2127
providers: [
2228
{ provide: LocationService, useValue: new MockLocationService('base/initial-url?some-query') },
2329
SearchService

aio/src/app/shared/search-results/search-results.component.spec.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
import { DebugElement } from '@angular/core';
1+
import { Component, DebugElement } from '@angular/core';
22
import { ComponentFixture, TestBed } from '@angular/core/testing';
33
import { By } from '@angular/platform-browser';
44
import { SearchResult } from 'app/search/interfaces';
55
import { SearchResultsComponent } from './search-results.component';
66

7+
@Component({
8+
selector: 'mat-icon',
9+
template: '',
10+
})
11+
class MockMatIcon {}
12+
713
describe('SearchResultsComponent', () => {
814

915
let component: SearchResultsComponent;
@@ -76,7 +82,7 @@ describe('SearchResultsComponent', () => {
7682

7783
beforeEach(() => {
7884
TestBed.configureTestingModule({
79-
declarations: [ SearchResultsComponent ]
85+
declarations: [ SearchResultsComponent, MockMatIcon ]
8086
});
8187
});
8288

0 commit comments

Comments
 (0)