@@ -11,9 +11,7 @@ import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
1111import { SearchService } from '../../../../core/shared/search/search.service' ;
1212import { TranslateLoaderMock } from '../../../mocks/translate-loader.mock' ;
1313import { CarouselSectionComponent } from './carousel-section.component' ;
14- import { SearchResult } from '../../../search/models/search-result.model' ;
15- import { DSpaceObject } from '../../../../core/shared/dspace-object.model' ;
16- import { createSuccessfulRemoteDataObject , createSuccessfulRemoteDataObject$ } from '../../../remote-data.utils' ;
14+ import { createSuccessfulRemoteDataObject$ } from '../../../remote-data.utils' ;
1715import { ObjectCacheService } from '../../../../core/cache/object-cache.service' ;
1816import { UUIDService } from '../../../../core/shared/uuid.service' ;
1917import { RemoteDataBuildService } from '../../../../core/cache/builders/remote-data-build.service' ;
@@ -25,6 +23,7 @@ import { HttpClient } from '@angular/common/http';
2523import { DSOChangeAnalyzer } from '../../../../core/data/dso-change-analyzer.service' ;
2624import { DefaultChangeAnalyzer } from '../../../../core/data/default-change-analyzer.service' ;
2725import { cold } from 'jasmine-marbles' ;
26+ import { ItemSearchResult } from '../../../object-collection/shared/item-search-result.model' ;
2827
2928describe ( 'CarouselSectionComponent' , ( ) => {
3029 let component : CarouselSectionComponent ;
@@ -33,27 +32,23 @@ describe('CarouselSectionComponent', () => {
3332 let searchServiceStub : any ;
3433 let notificationService : NotificationsServiceStub ;
3534
36- const searchResult = Object . assign ( new SearchResult ( ) , {
37- indexableObject : Object . assign ( new DSpaceObject ( ) , {
38- id : 'd317835d-7b06-4219-91e2-1191900cb897' ,
39- uuid : 'd317835d-7b06-4219-91e2-1191900cb897' ,
40- name : 'My first person' ,
41- metadata : {
42- 'dc.title' : [
43- { value : 'Test' }
44- ] ,
45- 'dc.description.abstract' : [
46- { value : 'Lorem Ipsum' }
47- ]
48- } ,
49- _links : {
50- content : { href : 'file-selflink' }
51- }
52- } )
35+ const searchResult = Object . assign ( new ItemSearchResult ( ) , {
36+ id : 'd317835d-7b06-4219-91e2-1191900cb897' ,
37+ uuid : 'd317835d-7b06-4219-91e2-1191900cb897' ,
38+ name : 'My first person' ,
39+ metadata : {
40+ 'dc.title' : [
41+ { value : 'Test' }
42+ ] ,
43+ 'dc.description.abstract' : [
44+ { value : 'Lorem Ipsum' }
45+ ]
46+ } ,
47+ _links : {
48+ content : { href : 'file-selflink' }
49+ }
5350 } ) ;
5451
55- const searchResultRD = createSuccessfulRemoteDataObject ( { page : [ searchResult ] } ) ;
56-
5752 beforeEach ( waitForAsync ( ( ) => {
5853 searchServiceStub = jasmine . createSpyObj ( 'SearchService' , {
5954 search : jasmine . createSpy ( 'search' ) ,
@@ -124,7 +119,7 @@ describe('CarouselSectionComponent', () => {
124119 } ) ) ;
125120
126121 it ( 'should init search results data properly' , ( done ) => {
127- const expected = cold ( '(a|)' , { a : searchResultRD } ) ;
122+ const expected = cold ( '(a|)' , { a : [ searchResult ] } ) ;
128123 expect ( component . searchResults$ ) . toBeObservable ( expected ) ;
129124 done ( ) ;
130125 } ) ;
0 commit comments