@@ -24,9 +24,8 @@ import { Community } from '../../core/shared/community.model';
2424import { Collection } from '../../core/shared/collection.model' ;
2525import flatten from 'lodash/flatten' ;
2626import { DsoWithdrawnReinstateModalService } from './dso-withdrawn-reinstate-service/dso-withdrawn-reinstate-modal.service' ;
27- import { AuthService } from 'src/app/core/auth/auth.service' ;
28- import { AuthServiceMock } from '../mocks/auth.service.mock' ;
2927import { CorrectionTypeDataService } from 'src/app/core/submission/correctiontype-data.service' ;
28+ import { createPaginatedList } from '../testing/utils.test' ;
3029
3130describe ( 'DSOEditMenuResolver' , ( ) => {
3231
@@ -152,7 +151,7 @@ describe('DSOEditMenuResolver', () => {
152151 } ) ;
153152
154153 correctionsDataService = jasmine . createSpyObj ( 'correctionsDataService' , {
155- findByItem : observableOf ( [ ] )
154+ findByItem : createSuccessfulRemoteDataObject$ ( createPaginatedList ( [ ] ) ) ,
156155 } ) ;
157156
158157 TestBed . configureTestingModule ( {
@@ -167,7 +166,6 @@ describe('DSOEditMenuResolver', () => {
167166 { provide : TranslateService , useValue : translate } ,
168167 { provide : NotificationsService , useValue : notificationsService } ,
169168 { provide : DsoWithdrawnReinstateModalService , useValue : dsoWithdrawnReinstateModalService } ,
170- { provide : AuthService , useValue : new AuthServiceMock ( ) } ,
171169 { provide : CorrectionTypeDataService , useValue : correctionsDataService } ,
172170 {
173171 provide : NgbModal , useValue : {
@@ -367,7 +365,7 @@ describe('DSOEditMenuResolver', () => {
367365 route = dsoRoute ( testItem ) ;
368366 } ) ;
369367
370- it ( 'should return Item-specific entries' , ( ) => {
368+ it ( 'should return Item-specific entries' , ( done : DoneFn ) => {
371369 const result = resolver . getDsoMenus ( testObject , route , state ) ;
372370 combineLatest ( result ) . pipe ( map ( flatten ) ) . subscribe ( ( menu ) => {
373371 const orcidEntry = menu . find ( entry => entry . id === 'orcid-dso' ) ;
@@ -388,18 +386,20 @@ describe('DSOEditMenuResolver', () => {
388386 expect ( claimEntry . active ) . toBeFalse ( ) ;
389387 expect ( claimEntry . visible ) . toBeFalse ( ) ;
390388 expect ( claimEntry . model . type ) . toEqual ( MenuItemType . ONCLICK ) ;
389+ done ( ) ;
391390 } ) ;
392391 } ) ;
393392
394- it ( 'should not return Community/Collection-specific entries' , ( ) => {
393+ it ( 'should not return Community/Collection-specific entries' , ( done : DoneFn ) => {
395394 const result = resolver . getDsoMenus ( testObject , route , state ) ;
396395 combineLatest ( result ) . pipe ( map ( flatten ) ) . subscribe ( ( menu ) => {
397396 const subscribeEntry = menu . find ( entry => entry . id === 'subscribe' ) ;
398397 expect ( subscribeEntry ) . toBeFalsy ( ) ;
398+ done ( ) ;
399399 } ) ;
400400 } ) ;
401401
402- it ( 'should return as third part the common list ' , ( ) => {
402+ it ( 'should return as third part the common list ' , ( done : DoneFn ) => {
403403 const result = resolver . getDsoMenus ( testObject , route , state ) ;
404404 combineLatest ( result ) . pipe ( map ( flatten ) ) . subscribe ( ( menu ) => {
405405 const editEntry = menu . find ( entry => entry . id === 'edit-dso' ) ;
@@ -410,6 +410,7 @@ describe('DSOEditMenuResolver', () => {
410410 expect ( ( editEntry . model as LinkMenuItemModel ) . link ) . toEqual (
411411 '/items/test-item-uuid/edit/metadata'
412412 ) ;
413+ done ( ) ;
413414 } ) ;
414415 } ) ;
415416 } ) ;
0 commit comments