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
This commit is contained in:
dario-piotrowicz 2022-09-17 22:56:23 +01:00 committed by Pawel Kozlowski
parent adb1a61677
commit 14cb9fb005
2 changed files with 15 additions and 3 deletions

View file

@ -7,7 +7,13 @@ import { SearchResults } from 'app/search/interfaces';
import { SearchResultsComponent } from 'app/shared/search-results/search-results.component';
import { SearchService } from 'app/search/search.service';
import { FileNotFoundSearchComponent } from './file-not-found-search.component';
import { Component } from '@angular/core';
@Component({
selector: 'mat-icon',
template: '',
})
class MockMatIcon {}
describe('FileNotFoundSearchComponent', () => {
let fixture: ComponentFixture<FileNotFoundSearchComponent>;
@ -17,7 +23,7 @@ describe('FileNotFoundSearchComponent', () => {
beforeEach(() => {
TestBed.configureTestingModule({
declarations: [ FileNotFoundSearchComponent, SearchResultsComponent ],
declarations: [ FileNotFoundSearchComponent, SearchResultsComponent, MockMatIcon ],
providers: [
{ provide: LocationService, useValue: new MockLocationService('base/initial-url?some-query') },
SearchService

View file

@ -1,9 +1,15 @@
import { DebugElement } from '@angular/core';
import { Component, DebugElement } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { SearchResult } from 'app/search/interfaces';
import { SearchResultsComponent } from './search-results.component';
@Component({
selector: 'mat-icon',
template: '',
})
class MockMatIcon {}
describe('SearchResultsComponent', () => {
let component: SearchResultsComponent;
@ -76,7 +82,7 @@ describe('SearchResultsComponent', () => {
beforeEach(() => {
TestBed.configureTestingModule({
declarations: [ SearchResultsComponent ]
declarations: [ SearchResultsComponent, MockMatIcon ]
});
});