@@ -14,6 +14,7 @@ import { Location } from '@angular/common';
1414import { of as observableOf } from 'rxjs' ;
1515import { routeServiceStub } from '../../shared/testing/route-service.stub' ;
1616import { LocationStub } from '../../shared/testing/location.stub' ;
17+ import { By } from '@angular/platform-browser' ;
1718import { ActivatedRouteStub } from '../../shared/testing/active-router.stub' ;
1819import { createSuccessfulRemoteDataObject } from '../../shared/remote-data.utils' ;
1920import { WorkspaceItem } from '../../core/submission/models/workspaceitem.model' ;
@@ -39,10 +40,6 @@ describe('WorkspaceitemsDeletePageComponent', () => {
3940 onDefaultLangChange : new EventEmitter ( )
4041 } ;
4142
42- const modalService = {
43- open : ( ) => { /** empty */ } ,
44- } ;
45-
4643 beforeEach ( async ( ) => {
4744 await TestBed . configureTestingModule ( {
4845 imports : [
@@ -94,12 +91,12 @@ describe('WorkspaceitemsDeletePageComponent', () => {
9491 } ) ;
9592 } ) ;
9693
97- /* it('should delete the target workspace item', () => {
98- spyOn((component as any).modalService, 'open').and.returnValue({});
94+ it ( 'should delete the target workspace item' , ( ) => {
95+ spyOn ( ( component as any ) . modalService , 'open' ) . and . returnValue ( { result : Promise . resolve ( 'ok' ) } ) ;
9996 component . confirmDelete ( By . css ( '#delete-modal' ) ) ;
10097 fixture . detectChanges ( ) ;
10198 expect ( ( component as any ) . modalService . open ) . toHaveBeenCalled ( ) ;
102- });*/
99+ } ) ;
103100
104101 it ( 'should call workspaceItemService.delete' , ( ) => {
105102 component . sendDeleteRequest ( ) ;
0 commit comments