test(docs-infra): fix warnings in `ThemeToggleComponent` unit tests. (#42259)

due to unknown `<mat-icon>` element

This commit fixes some warnings in the unit tests of the
`ThemeToggleComponent`, which were caused by the following:

- The `<mat-icon>` element used in `ToggleThemeComponent`'s template was
  not declared in tests.
- The `dark-theme.css` and `light-theme.css` files requested by
  `ToggleThemeComponent` were not available.

PR Close #42259
This commit is contained in:
George Kalpakas 2021-06-11 20:11:38 +03:00 committed by Alex Rickabaugh
parent edf3e5a9cf
commit a7d1e65a51
2 changed files with 13 additions and 2 deletions

View File

@ -172,7 +172,17 @@
"src/google385281288605d160.html"
],
"styles": [
"src/styles/main.scss"
"src/styles/main.scss",
{
"inject": false,
"input": "src/styles/custom-themes/dark-theme.scss",
"bundleName": "dark-theme"
},
{
"inject": false,
"input": "src/styles/custom-themes/light-theme.scss",
"bundleName": "light-theme"
}
],
"scripts": []
}

View File

@ -1,4 +1,5 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MatIconModule } from '@angular/material/icon';
import { By } from '@angular/platform-browser';
import { ThemeStorage, ThemeToggleComponent } from './theme-toggle.component';
@ -45,7 +46,7 @@ describe('ThemeToggleComponent', () => {
beforeEach(() => {
TestBed.configureTestingModule({
declarations: [ ThemeToggleComponent ],
providers: [ { provide: ThemeStorage, useClass: FakeThemeStorage } ],
imports: [ MatIconModule ],
});
fixture = TestBed.createComponent(ThemeToggleComponent);