mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-15 14:03:06 +00:00
fix CommunityAdminSearchResultListElementComponent tests
This commit is contained in:
@@ -15,6 +15,10 @@ import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service
|
||||
import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock';
|
||||
import { APP_CONFIG } from '../../../../../../config/app-config.interface';
|
||||
import { environment } from '../../../../../../environments/environment';
|
||||
import { mockTruncatableService } from '../../../../../shared/mocks/mock-trucatable.service';
|
||||
import {
|
||||
CommunitySearchResultListElementComponent
|
||||
} from '../../../../../shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component';
|
||||
|
||||
describe('CommunityAdminSearchResultListElementComponent', () => {
|
||||
let component: CommunityAdminSearchResultListElementComponent;
|
||||
@@ -37,11 +41,15 @@ describe('CommunityAdminSearchResultListElementComponent', () => {
|
||||
RouterTestingModule.withRoutes([]),
|
||||
CommunityAdminSearchResultListElementComponent
|
||||
],
|
||||
providers: [{ provide: TruncatableService, useValue: {} },
|
||||
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||
providers: [
|
||||
{ provide: TruncatableService, useValue: mockTruncatableService },
|
||||
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||
{ provide: APP_CONFIG, useValue: environment }],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
})
|
||||
.overrideComponent(CommunityAdminSearchResultListElementComponent, {
|
||||
remove: { imports: [CommunitySearchResultListElementComponent]}
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
@@ -52,6 +60,7 @@ describe('CommunityAdminSearchResultListElementComponent', () => {
|
||||
component.linkTypes = CollectionElementLinkType;
|
||||
component.index = 0;
|
||||
component.viewModes = ViewMode;
|
||||
component.ngOnInit();
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user