item.component.spec.ts (dspace-angular-dspace-7.0) | : | item.component.spec.ts (dspace-angular-dspace-7.1) | ||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
import { isNotEmpty } from '../../../../shared/empty.util'; | import { isNotEmpty } from '../../../../shared/empty.util'; | |||
import { TranslateLoaderMock } from '../../../../shared/mocks/translate-loader.m ock'; | import { TranslateLoaderMock } from '../../../../shared/mocks/translate-loader.m ock'; | |||
import { NotificationsService } from '../../../../shared/notifications/notificat ions.service'; | import { NotificationsService } from '../../../../shared/notifications/notificat ions.service'; | |||
import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-dat a.utils'; | import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-dat a.utils'; | |||
import { TruncatableService } from '../../../../shared/truncatable/truncatable.s ervice'; | import { TruncatableService } from '../../../../shared/truncatable/truncatable.s ervice'; | |||
import { TruncatePipe } from '../../../../shared/utils/truncate.pipe'; | import { TruncatePipe } from '../../../../shared/utils/truncate.pipe'; | |||
import { GenericItemPageFieldComponent } from '../../field-components/specific-f ield/generic/generic-item-page-field.component'; | import { GenericItemPageFieldComponent } from '../../field-components/specific-f ield/generic/generic-item-page-field.component'; | |||
import { compareArraysUsing, compareArraysUsingIds } from './item-relationships- utils'; | import { compareArraysUsing, compareArraysUsingIds } from './item-relationships- utils'; | |||
import { ItemComponent } from './item.component'; | import { ItemComponent } from './item.component'; | |||
import { createPaginatedList } from '../../../../shared/testing/utils.test'; | import { createPaginatedList } from '../../../../shared/testing/utils.test'; | |||
import { RouteService } from '../../../../core/services/route.service'; | ||||
import { MetadataValue } from '../../../../core/shared/metadata.models'; | ||||
export const iiifEnabled = Object.assign(new MetadataValue(),{ | ||||
'value': 'true', | ||||
'language': null, | ||||
'authority': null, | ||||
'confidence': -1, | ||||
'place': 0 | ||||
}); | ||||
export const iiifSearchEnabled = Object.assign(new MetadataValue(), { | ||||
'value': 'true', | ||||
'language': null, | ||||
'authority': null, | ||||
'confidence': -1, | ||||
'place': 0 | ||||
}); | ||||
export const mockRouteService = jasmine.createSpyObj('RouteService', ['getPrevio | ||||
usUrl']); | ||||
/** | /** | |||
* Create a generic test for an item-page-fields component using a mockItem and the type of component | * Create a generic test for an item-page-fields component using a mockItem and the type of component | |||
* @param {Item} mockItem The item to use for testing. The item needs to con tain just the metadata necessary to | * @param {Item} mockItem The item to use for testing. The item needs to con tain just the metadata necessary to | |||
* execute the tests for it's component. | * execute the tests for it's component. | |||
* @param component The type of component to create test cases for. | * @param component The type of component to create test cases for. | |||
* @returns {() => void} Returns a specDefinition for the test. | * @returns {() => void} Returns a specDefinition for the test. | |||
*/ | */ | |||
export function getItemPageFieldsTest(mockItem: Item, component) { | export function getItemPageFieldsTest(mockItem: Item, component) { | |||
return () => { | return () => { | |||
skipping to change at line 75 | skipping to change at line 95 | |||
{ provide: UUIDService, useValue: {} }, | { provide: UUIDService, useValue: {} }, | |||
{ provide: Store, useValue: {} }, | { provide: Store, useValue: {} }, | |||
{ provide: RemoteDataBuildService, useValue: {} }, | { provide: RemoteDataBuildService, useValue: {} }, | |||
{ provide: CommunityDataService, useValue: {} }, | { provide: CommunityDataService, useValue: {} }, | |||
{ provide: HALEndpointService, useValue: {} }, | { provide: HALEndpointService, useValue: {} }, | |||
{ provide: HttpClient, useValue: {} }, | { provide: HttpClient, useValue: {} }, | |||
{ provide: DSOChangeAnalyzer, useValue: {} }, | { provide: DSOChangeAnalyzer, useValue: {} }, | |||
{ provide: NotificationsService, useValue: {} }, | { provide: NotificationsService, useValue: {} }, | |||
{ provide: DefaultChangeAnalyzer, useValue: {} }, | { provide: DefaultChangeAnalyzer, useValue: {} }, | |||
{ provide: BitstreamDataService, useValue: mockBitstreamDataService }, | { provide: BitstreamDataService, useValue: mockBitstreamDataService }, | |||
{ provide: RouteService, useValue: {} } | ||||
], | ], | |||
schemas: [NO_ERRORS_SCHEMA] | schemas: [NO_ERRORS_SCHEMA] | |||
}).overrideComponent(component, { | }).overrideComponent(component, { | |||
set: { changeDetection: ChangeDetectionStrategy.Default } | set: { changeDetection: ChangeDetectionStrategy.Default } | |||
}).compileComponents(); | }).compileComponents(); | |||
})); | })); | |||
beforeEach(waitForAsync(() => { | beforeEach(waitForAsync(() => { | |||
fixture = TestBed.createComponent(component); | fixture = TestBed.createComponent(component); | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 22 lines changed or added |