mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
[DURACOM-191] fix some tests
This commit is contained in:
@@ -23,6 +23,7 @@ import {
|
||||
createSuccessfulRemoteDataObject$,
|
||||
} from '../../shared/remote-data.utils';
|
||||
import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub';
|
||||
import { FileDropzoneNoUploaderComponent } from '../../shared/upload/file-dropzone-no-uploader/file-dropzone-no-uploader.component';
|
||||
import { FileValueAccessorDirective } from '../../shared/utils/file-value-accessor.directive';
|
||||
import { FileValidator } from '../../shared/utils/require-file.validator';
|
||||
import { BatchImportPageComponent } from './batch-import-page.component';
|
||||
@@ -67,7 +68,13 @@ describe('BatchImportPageComponent', () => {
|
||||
{ provide: Location, useValue: locationStub },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
}).compileComponents();
|
||||
})
|
||||
.overrideComponent(BatchImportPageComponent, {
|
||||
remove: {
|
||||
imports: [FileDropzoneNoUploaderComponent],
|
||||
},
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
@@ -39,8 +39,7 @@ describe('AdminNotifyDashboardComponent', () => {
|
||||
results = buildPaginatedList(undefined, [searchResult1, searchResult2, searchResult3]);
|
||||
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [TranslateModule.forRoot(), NgbNavModule],
|
||||
declarations: [AdminNotifyDashboardComponent],
|
||||
imports: [TranslateModule.forRoot(), NgbNavModule, AdminNotifyDashboardComponent],
|
||||
providers: [{ provide: SearchService, useValue: { search: () => createSuccessfulRemoteDataObject$(results) } }],
|
||||
})
|
||||
.compileComponents();
|
||||
|
@@ -15,8 +15,7 @@ describe('AdminNotifyDetailModalComponent', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [TranslateModule.forRoot()],
|
||||
declarations: [AdminNotifyDetailModalComponent],
|
||||
imports: [TranslateModule.forRoot(), AdminNotifyDetailModalComponent],
|
||||
providers: [{ provide: NgbActiveModal, useValue: modalStub }],
|
||||
})
|
||||
.compileComponents();
|
||||
|
@@ -36,8 +36,7 @@ describe('AdminNotifyIncomingComponent', () => {
|
||||
'send': '',
|
||||
});
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [TranslateModule.forRoot()],
|
||||
declarations: [AdminNotifyIncomingComponent],
|
||||
imports: [TranslateModule.forRoot(), AdminNotifyIncomingComponent],
|
||||
providers: [
|
||||
{ provide: SEARCH_CONFIG_SERVICE, useValue: SearchConfigurationService },
|
||||
{ provide: RouteService, useValue: routeServiceStub },
|
||||
|
@@ -18,6 +18,8 @@ import { MockActivatedRoute } from '../../../../shared/mocks/active-router.mock'
|
||||
import { routeServiceStub } from '../../../../shared/testing/route-service.stub';
|
||||
import { RouterStub } from '../../../../shared/testing/router.stub';
|
||||
import { AdminNotifyLogsResultComponent } from './admin-notify-logs-result.component';
|
||||
import { SearchLabelsComponent } from '../../../../shared/search/search-labels/search-labels.component';
|
||||
import { ThemedSearchComponent } from '../../../../shared/search/themed-search.component';
|
||||
|
||||
describe('AdminNotifyLogsResultComponent', () => {
|
||||
let component: AdminNotifyLogsResultComponent;
|
||||
@@ -29,8 +31,7 @@ describe('AdminNotifyLogsResultComponent', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [TranslateModule.forRoot()],
|
||||
declarations: [AdminNotifyLogsResultComponent],
|
||||
imports: [TranslateModule.forRoot(), AdminNotifyLogsResultComponent],
|
||||
providers: [
|
||||
{ provide: RouteService, useValue: routeServiceStub },
|
||||
{ provide: Router, useValue: new RouterStub() },
|
||||
@@ -41,6 +42,14 @@ describe('AdminNotifyLogsResultComponent', () => {
|
||||
{ provide: RemoteDataBuildService, useValue: rdbService },
|
||||
provideMockStore({}),
|
||||
],
|
||||
})
|
||||
.overrideComponent(AdminNotifyLogsResultComponent, {
|
||||
remove: {
|
||||
imports: [
|
||||
SearchLabelsComponent,
|
||||
ThemedSearchComponent,
|
||||
],
|
||||
},
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
|
@@ -48,7 +48,13 @@ describe('BrowseByPageComponent', () => {
|
||||
{ provide: ActivatedRoute, useValue: activatedRoute },
|
||||
{ provide: ThemeService, useValue: themeService },
|
||||
],
|
||||
}).compileComponents();
|
||||
})
|
||||
.overrideComponent(BrowseByPageComponent, {
|
||||
remove: {
|
||||
imports: [BrowseBySwitcherComponent],
|
||||
},
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(BrowseByPageComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
@@ -18,6 +18,7 @@ import { DSONameServiceMock } from '../../../../shared/mocks/dso-name.service.mo
|
||||
import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils';
|
||||
import { TruncatableService } from '../../../../shared/truncatable/truncatable.service';
|
||||
import { TruncatePipe } from '../../../../shared/utils/truncate.pipe';
|
||||
import { PersonSearchResultGridElementComponent } from '../search-result-grid-elements/person/person-search-result-grid-element.component';
|
||||
import { PersonGridElementComponent } from './person-grid-element.component';
|
||||
|
||||
const mockItem = Object.assign(new Item(), {
|
||||
@@ -62,6 +63,7 @@ describe('PersonGridElementComponent', () => {
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
}).overrideComponent(PersonGridElementComponent, {
|
||||
add: { changeDetection: ChangeDetectionStrategy.Default },
|
||||
remove: { imports: [PersonSearchResultGridElementComponent] },
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
|
@@ -23,6 +23,10 @@ import { ThemeService } from '../../../../../shared/theme-support/theme.service'
|
||||
import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
|
||||
import { TruncatePipe } from '../../../../../shared/utils/truncate.pipe';
|
||||
import { ProjectSearchResultListElementComponent } from './project-search-result-list-element.component';
|
||||
import { ThumbnailComponent } from '../../../../../thumbnail/thumbnail.component';
|
||||
import { NgClass } from '@angular/common';
|
||||
import { TruncatableComponent } from '../../../../../shared/truncatable/truncatable.component';
|
||||
import { ThemedBadgesComponent } from '../../../../../shared/object-collection/shared/badges/themed-badges.component';
|
||||
|
||||
let projectListElementComponent: ProjectSearchResultListElementComponent;
|
||||
let fixture: ComponentFixture<ProjectSearchResultListElementComponent>;
|
||||
@@ -91,6 +95,7 @@ describe('ProjectSearchResultListElementComponent', () => {
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
}).overrideComponent(ProjectSearchResultListElementComponent, {
|
||||
add: { changeDetection: ChangeDetectionStrategy.Default },
|
||||
remove: { imports: [ThumbnailComponent, TruncatableComponent, ThemedBadgesComponent] },
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
|
@@ -3,11 +3,12 @@ import {
|
||||
ComponentFixture,
|
||||
TestBed,
|
||||
} from '@angular/core/testing';
|
||||
|
||||
import { QualityAssuranceSourcePageComponent } from './quality-assurance-source-page.component';
|
||||
import { ActivatedRouteStub } from '../../shared/testing/active-router.stub';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
|
||||
import { QualityAssuranceSourceComponent } from '../../notifications/qa/source/quality-assurance-source.component';
|
||||
import { ActivatedRouteStub } from '../../shared/testing/active-router.stub';
|
||||
import { QualityAssuranceSourcePageComponent } from './quality-assurance-source-page.component';
|
||||
|
||||
describe('QualityAssuranceSourcePageComponent', () => {
|
||||
let component: QualityAssuranceSourcePageComponent;
|
||||
let fixture: ComponentFixture<QualityAssuranceSourcePageComponent>;
|
||||
@@ -19,6 +20,11 @@ describe('QualityAssuranceSourcePageComponent', () => {
|
||||
{ provide: ActivatedRoute, useValue: new ActivatedRouteStub() },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
})
|
||||
.overrideComponent(QualityAssuranceSourcePageComponent, {
|
||||
remove: {
|
||||
imports: [QualityAssuranceSourceComponent],
|
||||
},
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
@@ -4,7 +4,10 @@ import {
|
||||
ComponentFixture,
|
||||
TestBed,
|
||||
} from '@angular/core/testing';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
|
||||
import { QualityAssuranceTopicsComponent } from '../../notifications/qa/topics/quality-assurance-topics.component';
|
||||
import { ActivatedRouteStub } from '../../shared/testing/active-router.stub';
|
||||
import { QualityAssuranceTopicsPageComponent } from './quality-assurance-topics-page.component';
|
||||
|
||||
describe('QualityAssuranceTopicsPageComponent', () => {
|
||||
@@ -14,7 +17,15 @@ describe('QualityAssuranceTopicsPageComponent', () => {
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [QualityAssuranceTopicsPageComponent],
|
||||
providers: [
|
||||
{ provide: ActivatedRoute, useValue: new ActivatedRouteStub() },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
})
|
||||
.overrideComponent(QualityAssuranceTopicsPageComponent, {
|
||||
remove: {
|
||||
imports: [QualityAssuranceTopicsComponent],
|
||||
},
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
@@ -23,9 +23,11 @@ import { WorkflowItem } from '../../../../core/submission/models/workflowitem.mo
|
||||
import { ClaimedTask } from '../../../../core/tasks/models/claimed-task-object.model';
|
||||
import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock';
|
||||
import { getMockLinkService } from '../../../mocks/link-service.mock';
|
||||
import { ClaimedTaskActionsComponent } from '../../../mydspace-actions/claimed-task/claimed-task-actions.component';
|
||||
import { ClaimedTaskSearchResult } from '../../../object-collection/shared/claimed-task-search-result.model';
|
||||
import { createSuccessfulRemoteDataObject } from '../../../remote-data.utils';
|
||||
import { VarDirective } from '../../../utils/var.directive';
|
||||
import { ItemDetailPreviewComponent } from '../item-detail-preview/item-detail-preview.component';
|
||||
import { ClaimedTaskSearchResultDetailElementComponent } from './claimed-task-search-result-detail-element.component';
|
||||
|
||||
let component: ClaimedTaskSearchResultDetailElementComponent;
|
||||
@@ -86,6 +88,9 @@ describe('ClaimedTaskSearchResultDetailElementComponent', () => {
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
}).overrideComponent(ClaimedTaskSearchResultDetailElementComponent, {
|
||||
add: { changeDetection: ChangeDetectionStrategy.Default },
|
||||
remove: {
|
||||
imports: [ItemDetailPreviewComponent, ClaimedTaskActionsComponent],
|
||||
},
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
|
@@ -14,7 +14,9 @@ import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
||||
import { Context } from '../../../../core/shared/context.model';
|
||||
import { Item } from '../../../../core/shared/item.model';
|
||||
import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock';
|
||||
import { ItemActionsComponent } from '../../../mydspace-actions/item/item-actions.component';
|
||||
import { ItemSearchResult } from '../../../object-collection/shared/item-search-result.model';
|
||||
import { ItemDetailPreviewComponent } from '../item-detail-preview/item-detail-preview.component';
|
||||
import { ItemSearchResultDetailElementComponent } from './item-search-result-detail-element.component';
|
||||
|
||||
let component: ItemSearchResultDetailElementComponent;
|
||||
@@ -65,6 +67,9 @@ describe('ItemSearchResultDetailElementComponent', () => {
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
}).overrideComponent(ItemSearchResultDetailElementComponent, {
|
||||
add: { changeDetection: ChangeDetectionStrategy.Default },
|
||||
remove: {
|
||||
imports: [ItemDetailPreviewComponent, ItemActionsComponent],
|
||||
},
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
|
@@ -45,6 +45,9 @@ import { ThemeService } from '../../../theme-support/theme.service';
|
||||
import { TruncatableService } from '../../../truncatable/truncatable.service';
|
||||
import { VarDirective } from '../../../utils/var.directive';
|
||||
import { ClaimedSearchResultListElementComponent } from './claimed-search-result-list-element.component';
|
||||
import { AsyncPipe, NgClass, NgIf } from '@angular/common';
|
||||
import { ThemedItemListPreviewComponent } from '../item-list-preview/themed-item-list-preview.component';
|
||||
import { ClaimedTaskActionsComponent } from '../../../mydspace-actions/claimed-task/claimed-task-actions.component';
|
||||
|
||||
let component: ClaimedSearchResultListElementComponent;
|
||||
let fixture: ComponentFixture<ClaimedSearchResultListElementComponent>;
|
||||
@@ -129,6 +132,9 @@ describe('ClaimedSearchResultListElementComponent', () => {
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
}).overrideComponent(ClaimedSearchResultListElementComponent, {
|
||||
add: { changeDetection: ChangeDetectionStrategy.Default },
|
||||
remove: {
|
||||
imports: [ThemedItemListPreviewComponent, ClaimedTaskActionsComponent],
|
||||
},
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
|
Reference in New Issue
Block a user