Commits
Enea Jahollari authored 0692f6e28bf
7 7 | import { Item } from '../../../../../core/shared/item.model'; |
8 8 | import { Relationship } from '../../../../../core/shared/item-relationships/relationship.model'; |
9 9 | import { RelationshipOptions } from '../../models/relationship-options.model'; |
10 10 | import { RemoveRelationshipAction } from '../relation-lookup-modal/relationship.actions'; |
11 11 | import { ItemSearchResult } from '../../../../object-collection/shared/item-search-result.model'; |
12 12 | import { of as observableOf } from 'rxjs'; |
13 13 | import { ReorderableRelationship } from '../existing-metadata-list-element/existing-metadata-list-element.component'; |
14 14 | import { createSuccessfulRemoteDataObject$ } from '../../../../remote-data.utils'; |
15 15 | import { SubmissionService } from '../../../../../submission/submission.service'; |
16 16 | import { SubmissionServiceStub } from '../../../../testing/submission-service.stub'; |
17 + | import { TranslateModule } from '@ngx-translate/core'; |
18 + | import { |
19 + | ListableObjectComponentLoaderComponent |
20 + | } from '../../../../object-collection/shared/listable-object/listable-object-component-loader.component'; |
17 21 | |
18 22 | describe('ExistingRelationListElementComponent', () => { |
19 23 | let component: ExistingRelationListElementComponent; |
20 24 | let fixture: ComponentFixture<ExistingRelationListElementComponent>; |
21 25 | let selectionService; |
22 26 | let store; |
23 27 | let listID; |
24 28 | let submissionItem; |
25 29 | let relationship; |
26 30 | let reoRel; |
58 62 | } as any; |
59 63 | |
60 64 | relationship = Object.assign(new Relationship(), { leftItem: leftItemRD$, rightItem: rightItemRD$ }); |
61 65 | submissionId = '1234'; |
62 66 | reoRel = new ReorderableRelationship(relationship, true, relationshipService, {} as any, submissionId); |
63 67 | } |
64 68 | |
65 69 | beforeEach(waitForAsync(() => { |
66 70 | init(); |
67 71 | TestBed.configureTestingModule({ |
68 - | imports: [ExistingRelationListElementComponent], |
72 + | imports: [ |
73 + | TranslateModule.forRoot(), |
74 + | ExistingRelationListElementComponent |
75 + | ], |
69 76 | providers: [ |
70 77 | { provide: SelectableListService, useValue: selectionService }, |
71 78 | { provide: Store, useValue: store }, |
72 79 | { provide: SubmissionService, useClass: SubmissionServiceStub } |
73 80 | ], |
74 81 | schemas: [NO_ERRORS_SCHEMA] |
75 82 | }) |
83 + | .overrideComponent(ExistingRelationListElementComponent, { |
84 + | remove: { imports: [ListableObjectComponentLoaderComponent]} |
85 + | }) |
76 86 | .compileComponents(); |
77 87 | })); |
78 88 | |
79 89 | beforeEach(() => { |
80 90 | fixture = TestBed.createComponent(ExistingRelationListElementComponent); |
81 91 | component = fixture.componentInstance; |
82 92 | component.listId = listID; |
83 93 | component.submissionItem = submissionItem; |
84 94 | component.reoRel = reoRel; |
85 95 | component.metadataFields = metadataFields; |