fix ThumbnailComponent tests

This commit is contained in:
Enea Jahollari
2023-09-27 11:47:43 +02:00
parent fdd08d2a22
commit 45354dba2b
2 changed files with 20 additions and 2 deletions

View File

@@ -8,6 +8,8 @@ import {
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { ThemeService } from './app/shared/theme-support/theme.service';
import { getMockThemeService } from './app/shared/mocks/theme-service.mock';
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
@@ -16,6 +18,10 @@ getTestBed().initTestEnvironment(
{ teardown: { destroyAfterEach: false } }
);
jasmine.getEnv().beforeEach(() => {
getTestBed().overrideProvider(ThemeService, { useValue: getMockThemeService() });
});
jasmine.getEnv().afterEach(() => {
// If store is mocked, reset state after each test (see https://ngrx.io/guide/migration/v13)
getTestBed().inject(MockStore, null)?.resetSelectors();