Commits
Yura Bondarenko authored e15da9b76be
7 7 | import { TranslateModule } from '@ngx-translate/core'; |
8 8 | import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; |
9 9 | import { CollectionElementLinkType } from '../../../../../shared/object-collection/collection-element-link.type'; |
10 10 | import { ViewMode } from '../../../../../core/shared/view-mode.model'; |
11 11 | import { CollectionSearchResult } from '../../../../../shared/object-collection/shared/collection-search-result.model'; |
12 12 | import { Collection } from '../../../../../core/shared/collection.model'; |
13 13 | import { By } from '@angular/platform-browser'; |
14 14 | import { RouterTestingModule } from '@angular/router/testing'; |
15 15 | import { getCollectionEditRoute } from '../../../../../collection-page/collection-page-routing-paths'; |
16 16 | import { LinkService } from '../../../../../core/cache/builders/link.service'; |
17 + | import { AuthService } from '../../../../../core/auth/auth.service'; |
18 + | import { AuthServiceStub } from '../../../../../shared/testing/auth-service.stub'; |
19 + | import { FileService } from '../../../../../core/shared/file.service'; |
20 + | import { FileServiceStub } from '../../../../../shared/testing/file-service.stub'; |
21 + | import { AuthorizationDataService } from '../../../../../core/data/feature-authorization/authorization-data.service'; |
22 + | import { AuthorizationDataServiceStub } from '../../../../../shared/testing/authorization-service.stub'; |
17 23 | |
18 24 | describe('CollectionAdminSearchResultGridElementComponent', () => { |
19 25 | let component: CollectionAdminSearchResultGridElementComponent; |
20 26 | let fixture: ComponentFixture<CollectionAdminSearchResultGridElementComponent>; |
21 27 | let id; |
22 28 | let searchResult; |
23 29 | |
24 30 | function init() { |
25 31 | id = '780b2588-bda5-4112-a1cd-0b15000a5339'; |
26 32 | searchResult = new CollectionSearchResult(); |
38 44 | imports: [ |
39 45 | NoopAnimationsModule, |
40 46 | TranslateModule.forRoot(), |
41 47 | RouterTestingModule.withRoutes([]), |
42 48 | SharedModule |
43 49 | ], |
44 50 | declarations: [CollectionAdminSearchResultGridElementComponent], |
45 51 | providers: [ |
46 52 | { provide: TruncatableService, useValue: mockTruncatableService }, |
47 53 | { provide: BitstreamDataService, useValue: {} }, |
48 - | { provide: LinkService, useValue: linkService } |
54 + | { provide: LinkService, useValue: linkService }, |
55 + | { provide: AuthService, useClass: AuthServiceStub }, |
56 + | { provide: FileService, useClass: FileServiceStub }, |
57 + | { provide: AuthorizationDataService, useClass: AuthorizationDataServiceStub }, |
49 58 | ] |
50 59 | }) |
51 60 | .compileComponents(); |
52 61 | })); |
53 62 | |
54 63 | beforeEach(() => { |
55 64 | fixture = TestBed.createComponent(CollectionAdminSearchResultGridElementComponent); |
56 65 | component = fixture.componentInstance; |
57 66 | component.object = searchResult; |
58 67 | component.linkTypes = CollectionElementLinkType; |