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:
parent
edf3e5a9cf
commit
a7d1e65a51
|
@ -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": []
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue