Skip to content

Commit cf403dc

Browse files
committed
test(docs-infra): fix warnings in ThemeToggleComponent unit tests.
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.
1 parent 2caf4b2 commit cf403dc

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

aio/angular.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,17 @@
172172
"src/google385281288605d160.html"
173173
],
174174
"styles": [
175-
"src/styles/main.scss"
175+
"src/styles/main.scss",
176+
{
177+
"inject": false,
178+
"input": "src/styles/custom-themes/dark-theme.scss",
179+
"bundleName": "dark-theme"
180+
},
181+
{
182+
"inject": false,
183+
"input": "src/styles/custom-themes/light-theme.scss",
184+
"bundleName": "light-theme"
185+
}
176186
],
177187
"scripts": []
178188
}

aio/src/app/shared/theme-picker/theme-toggle.component.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { ComponentFixture, TestBed } from '@angular/core/testing';
2+
import { MatIconModule } from '@angular/material/icon';
23
import { By } from '@angular/platform-browser';
34
import { ThemeStorage, ThemeToggleComponent } from './theme-toggle.component';
45

@@ -45,7 +46,7 @@ describe('ThemeToggleComponent', () => {
4546
beforeEach(() => {
4647
TestBed.configureTestingModule({
4748
declarations: [ ThemeToggleComponent ],
48-
providers: [ { provide: ThemeStorage, useClass: FakeThemeStorage } ],
49+
imports: [ MatIconModule ],
4950
});
5051

5152
fixture = TestBed.createComponent(ThemeToggleComponent);

0 commit comments

Comments
 (0)