feat: fix CollectionDropdownComponent test

This commit is contained in:
Enea Jahollari
2023-09-26 09:45:03 +02:00
parent b0af3e7b8d
commit 65e786bd1f

View File

@@ -15,6 +15,8 @@ import { CollectionDataService } from '../../core/data/collection-data.service';
import { TranslateLoaderMock } from '../mocks/translate-loader.mock';
import { Community } from '../../core/shared/community.model';
import { MockElementRef } from '../testing/element-ref.mock';
import { getMockThemeService } from '../mocks/theme-service.mock';
import { ThemeService } from '../theme-support/theme.service';
const community: Community = Object.assign(new Community(), {
id: 'ce64f48e-2c9b-411a-ac36-ee429c0e6a88',
@@ -100,6 +102,8 @@ describe('CollectionDropdownComponent', () => {
let fixture: ComponentFixture<CollectionDropdownComponent>;
let scheduler: TestScheduler;
let themeService = getMockThemeService();
const collectionDataServiceMock: any = jasmine.createSpyObj('CollectionDataService', {
getAuthorizedCollection: jasmine.createSpy('getAuthorizedCollection'),
getAuthorizedCollectionByEntityType: jasmine.createSpy('getAuthorizedCollectionByEntityType')
@@ -125,7 +129,8 @@ describe('CollectionDropdownComponent', () => {
providers: [
{provide: CollectionDataService, useValue: collectionDataServiceMock},
{provide: ElementRef, useClass: MockElementRef},
ChangeDetectorRef
ChangeDetectorRef,
{provide: ThemeService, useValue: themeService},
],
schemas: [NO_ERRORS_SCHEMA]
})