mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
[DURACOM-191] fix tests
This commit is contained in:
@@ -33,6 +33,7 @@ import { AuthService } from '../../../../../core/auth/auth.service';
|
|||||||
import { AuthServiceMock } from '../../../../../shared/mocks/auth.service.mock';
|
import { AuthServiceMock } from '../../../../../shared/mocks/auth.service.mock';
|
||||||
import { AuthorizationDataServiceStub } from '../../../../../shared/testing/authorization-service.stub';
|
import { AuthorizationDataServiceStub } from '../../../../../shared/testing/authorization-service.stub';
|
||||||
import { AuthorizationDataService } from '../../../../../core/data/feature-authorization/authorization-data.service';
|
import { AuthorizationDataService } from '../../../../../core/data/feature-authorization/authorization-data.service';
|
||||||
|
import { ListableModule } from '../../../../../core/shared/listable.module';
|
||||||
|
|
||||||
describe('WorkflowItemSearchResultAdminWorkflowGridElementComponent', () => {
|
describe('WorkflowItemSearchResultAdminWorkflowGridElementComponent', () => {
|
||||||
let component: WorkflowItemSearchResultAdminWorkflowGridElementComponent;
|
let component: WorkflowItemSearchResultAdminWorkflowGridElementComponent;
|
||||||
@@ -63,7 +64,8 @@ describe('WorkflowItemSearchResultAdminWorkflowGridElementComponent', () => {
|
|||||||
NoopAnimationsModule,
|
NoopAnimationsModule,
|
||||||
TranslateModule.forRoot(),
|
TranslateModule.forRoot(),
|
||||||
RouterTestingModule.withRoutes([]),
|
RouterTestingModule.withRoutes([]),
|
||||||
ItemGridElementComponent, ListableObjectDirective
|
ListableObjectDirective,
|
||||||
|
ListableModule
|
||||||
],
|
],
|
||||||
declarations: [WorkflowItemSearchResultAdminWorkflowGridElementComponent],
|
declarations: [WorkflowItemSearchResultAdminWorkflowGridElementComponent],
|
||||||
providers: [
|
providers: [
|
||||||
@@ -79,11 +81,6 @@ describe('WorkflowItemSearchResultAdminWorkflowGridElementComponent', () => {
|
|||||||
{ provide: AuthorizationDataService, useClass: AuthorizationDataServiceStub },
|
{ provide: AuthorizationDataService, useClass: AuthorizationDataServiceStub },
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
})
|
|
||||||
.overrideComponent(WorkflowItemSearchResultAdminWorkflowGridElementComponent, {
|
|
||||||
add: {
|
|
||||||
entryComponents: [ItemGridElementComponent]
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
}));
|
}));
|
||||||
|
@@ -16,9 +16,6 @@ import { WorkflowItem } from '../../../../../core/submission/models/workflowitem
|
|||||||
import { LinkService } from '../../../../../core/cache/builders/link.service';
|
import { LinkService } from '../../../../../core/cache/builders/link.service';
|
||||||
import { followLink } from '../../../../../shared/utils/follow-link-config.model';
|
import { followLink } from '../../../../../shared/utils/follow-link-config.model';
|
||||||
import { Item } from '../../../../../core/shared/item.model';
|
import { Item } from '../../../../../core/shared/item.model';
|
||||||
import {
|
|
||||||
ItemGridElementComponent
|
|
||||||
} from '../../../../../shared/object-grid/item-grid-element/item-types/item/item-grid-element.component';
|
|
||||||
import {
|
import {
|
||||||
ListableObjectDirective
|
ListableObjectDirective
|
||||||
} from '../../../../../shared/object-collection/shared/listable-object/listable-object.directive';
|
} from '../../../../../shared/object-collection/shared/listable-object/listable-object.directive';
|
||||||
@@ -41,6 +38,7 @@ import { NotificationsServiceStub } from '../../../../../shared/testing/notifica
|
|||||||
import { AuthService } from '../../../../../core/auth/auth.service';
|
import { AuthService } from '../../../../../core/auth/auth.service';
|
||||||
import { AuthServiceMock } from '../../../../../shared/mocks/auth.service.mock';
|
import { AuthServiceMock } from '../../../../../shared/mocks/auth.service.mock';
|
||||||
import { AuthorizationDataService } from '../../../../../core/data/feature-authorization/authorization-data.service';
|
import { AuthorizationDataService } from '../../../../../core/data/feature-authorization/authorization-data.service';
|
||||||
|
import { ListableModule } from '../../../../../core/shared/listable.module';
|
||||||
|
|
||||||
describe('WorkspaceItemSearchResultAdminWorkflowGridElementComponent', () => {
|
describe('WorkspaceItemSearchResultAdminWorkflowGridElementComponent', () => {
|
||||||
let component: WorkspaceItemSearchResultAdminWorkflowGridElementComponent;
|
let component: WorkspaceItemSearchResultAdminWorkflowGridElementComponent;
|
||||||
@@ -76,7 +74,8 @@ describe('WorkspaceItemSearchResultAdminWorkflowGridElementComponent', () => {
|
|||||||
NoopAnimationsModule,
|
NoopAnimationsModule,
|
||||||
TranslateModule.forRoot(),
|
TranslateModule.forRoot(),
|
||||||
RouterTestingModule.withRoutes([]),
|
RouterTestingModule.withRoutes([]),
|
||||||
ItemGridElementComponent, ListableObjectDirective
|
ListableModule,
|
||||||
|
ListableObjectDirective
|
||||||
],
|
],
|
||||||
declarations: [WorkspaceItemSearchResultAdminWorkflowGridElementComponent],
|
declarations: [WorkspaceItemSearchResultAdminWorkflowGridElementComponent],
|
||||||
providers: [
|
providers: [
|
||||||
@@ -95,11 +94,6 @@ describe('WorkspaceItemSearchResultAdminWorkflowGridElementComponent', () => {
|
|||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
})
|
})
|
||||||
.overrideComponent(WorkspaceItemSearchResultAdminWorkflowGridElementComponent, {
|
|
||||||
set: {
|
|
||||||
entryComponents: [ItemGridElementComponent]
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@@ -99,14 +99,8 @@ describe('JournalIssueSearchResultListElementComponent', () => {
|
|||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).overrideComponent(JournalIssueSearchResultListElementComponent, {
|
}).overrideComponent(JournalIssueSearchResultListElementComponent, {
|
||||||
add: { changeDetection: ChangeDetectionStrategy.Default },
|
add: { changeDetection: ChangeDetectionStrategy.Default }}
|
||||||
remove: { imports: [
|
).compileComponents();
|
||||||
ThumbnailComponent,
|
|
||||||
ThemedBadgesComponent,
|
|
||||||
TruncatableComponent,
|
|
||||||
TruncatablePartComponent,
|
|
||||||
]}
|
|
||||||
}).compileComponents();
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
@@ -184,7 +178,8 @@ describe('JournalIssueSearchResultListElementComponent', () => {
|
|||||||
|
|
||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [JournalIssueSearchResultListElementComponent, TruncatePipe, TranslateModule.forRoot(),],
|
imports: [TruncatePipe, TranslateModule.forRoot(),],
|
||||||
|
declarations: [JournalIssueSearchResultListElementComponent],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: TruncatableService, useValue: mockTruncatableService },
|
{ provide: TruncatableService, useValue: mockTruncatableService },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock },
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
|
@@ -172,7 +172,8 @@ describe('JournalVolumeSearchResultListElementComponent', () => {
|
|||||||
|
|
||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [JournalVolumeSearchResultListElementComponent, TruncatePipe],
|
imports: [TruncatePipe],
|
||||||
|
declarations: [JournalVolumeSearchResultListElementComponent],
|
||||||
providers: [
|
providers: [
|
||||||
{provide: TruncatableService, useValue: mockTruncatableService},
|
{provide: TruncatableService, useValue: mockTruncatableService},
|
||||||
{provide: DSONameService, useClass: DSONameServiceMock},
|
{provide: DSONameService, useClass: DSONameServiceMock},
|
||||||
|
@@ -141,7 +141,8 @@ describe('JournalSearchResultListElementComponent', () => {
|
|||||||
|
|
||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [JournalSearchResultListElementComponent, TruncatePipe, TranslateModule.forRoot()],
|
imports: [TruncatePipe, TranslateModule.forRoot()],
|
||||||
|
declarations: [JournalSearchResultListElementComponent],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: TruncatableService, useValue: mockTruncatableService },
|
{ provide: TruncatableService, useValue: mockTruncatableService },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock },
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
|
@@ -159,7 +159,8 @@ describe('OrgUnitSearchResultListElementComponent', () => {
|
|||||||
provide: TranslateLoader,
|
provide: TranslateLoader,
|
||||||
useClass: TranslateLoaderMock
|
useClass: TranslateLoaderMock
|
||||||
}
|
}
|
||||||
}), OrgUnitSearchResultListElementComponent, TruncatePipe],
|
}), TruncatePipe],
|
||||||
|
declarations: [OrgUnitSearchResultListElementComponent],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: TruncatableService, useValue: mockTruncatableService },
|
{ provide: TruncatableService, useValue: mockTruncatableService },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock },
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
@@ -170,7 +171,6 @@ describe('OrgUnitSearchResultListElementComponent', () => {
|
|||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).overrideComponent(OrgUnitSearchResultListElementComponent, {
|
}).overrideComponent(OrgUnitSearchResultListElementComponent, {
|
||||||
add: {changeDetection: ChangeDetectionStrategy.Default},
|
add: {changeDetection: ChangeDetectionStrategy.Default},
|
||||||
remove: { imports: [ ThumbnailComponent, ThemedBadgesComponent, TruncatableComponent, TruncatablePartComponent,]}
|
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@@ -136,6 +136,7 @@ export function getItemPageFieldsTest(mockItem: Item, component) {
|
|||||||
TruncatePipe,
|
TruncatePipe,
|
||||||
AsyncPipe,
|
AsyncPipe,
|
||||||
],
|
],
|
||||||
|
declarations: [component],
|
||||||
providers: [
|
providers: [
|
||||||
{
|
{
|
||||||
provide: APP_CONFIG,
|
provide: APP_CONFIG,
|
||||||
|
@@ -221,8 +221,7 @@ describe('ItemSearchResultListElementComponent', () => {
|
|||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).overrideComponent(ItemSearchResultListElementComponent, {
|
}).overrideComponent(ItemSearchResultListElementComponent, {
|
||||||
add: { changeDetection: ChangeDetectionStrategy.Default },
|
add: { changeDetection: ChangeDetectionStrategy.Default }
|
||||||
remove: { imports: [ThumbnailComponent, ThemedBadgesComponent, TruncatableComponent, TruncatablePartComponent] }
|
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@@ -396,7 +395,8 @@ describe('ItemSearchResultListElementComponent', () => {
|
|||||||
|
|
||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [ItemSearchResultListElementComponent, TruncatePipe, TranslateModule.forRoot()],
|
imports: [TruncatePipe, TranslateModule.forRoot()],
|
||||||
|
declarations: [ItemSearchResultListElementComponent],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: TruncatableService, useValue: mockTruncatableService },
|
{ provide: TruncatableService, useValue: mockTruncatableService },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock },
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
|
Reference in New Issue
Block a user