This commit is contained in:
Giuseppe Digilio
2023-05-18 23:21:45 +02:00
parent 0c6994ba14
commit 008dee60c1

View File

@@ -14,6 +14,7 @@ import { Location } from '@angular/common';
import { of as observableOf } from 'rxjs'; import { of as observableOf } from 'rxjs';
import { routeServiceStub } from '../../shared/testing/route-service.stub'; import { routeServiceStub } from '../../shared/testing/route-service.stub';
import { LocationStub } from '../../shared/testing/location.stub'; import { LocationStub } from '../../shared/testing/location.stub';
import { By } from '@angular/platform-browser';
import { ActivatedRouteStub } from '../../shared/testing/active-router.stub'; import { ActivatedRouteStub } from '../../shared/testing/active-router.stub';
import { createSuccessfulRemoteDataObject } from '../../shared/remote-data.utils'; import { createSuccessfulRemoteDataObject } from '../../shared/remote-data.utils';
import { WorkspaceItem } from '../../core/submission/models/workspaceitem.model'; import { WorkspaceItem } from '../../core/submission/models/workspaceitem.model';
@@ -39,10 +40,6 @@ describe('WorkspaceitemsDeletePageComponent', () => {
onDefaultLangChange: new EventEmitter() onDefaultLangChange: new EventEmitter()
}; };
const modalService = {
open: () => {/** empty */},
};
beforeEach(async () => { beforeEach(async () => {
await TestBed.configureTestingModule({ await TestBed.configureTestingModule({
imports: [ imports: [
@@ -94,12 +91,12 @@ describe('WorkspaceitemsDeletePageComponent', () => {
}); });
}); });
/*it('should delete the target workspace item', () => { it('should delete the target workspace item', () => {
spyOn((component as any).modalService, 'open').and.returnValue({}); spyOn((component as any).modalService, 'open').and.returnValue({result: Promise.resolve('ok')});
component.confirmDelete(By.css('#delete-modal')); component.confirmDelete(By.css('#delete-modal'));
fixture.detectChanges(); fixture.detectChanges();
expect((component as any).modalService.open).toHaveBeenCalled(); expect((component as any).modalService.open).toHaveBeenCalled();
});*/ });
it('should call workspaceItemService.delete', () => { it('should call workspaceItemService.delete', () => {
component.sendDeleteRequest(); component.sendDeleteRequest();