mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
[DURACOM-134] Fixes
This commit is contained in:
@@ -25,7 +25,7 @@ describe('WorkspaceitemsDeletePageComponent', () => {
|
|||||||
let fixture: ComponentFixture<WorkspaceItemsDeletePageComponent>;
|
let fixture: ComponentFixture<WorkspaceItemsDeletePageComponent>;
|
||||||
|
|
||||||
const workspaceitemDataServiceSpy = jasmine.createSpyObj('WorkspaceitemDataService', {
|
const workspaceitemDataServiceSpy = jasmine.createSpyObj('WorkspaceitemDataService', {
|
||||||
delete: jasmine.createSpy('delete')
|
delete: observableOf(createSuccessfulRemoteDataObject({}))
|
||||||
});
|
});
|
||||||
|
|
||||||
const wsi = new WorkspaceItem();
|
const wsi = new WorkspaceItem();
|
||||||
@@ -88,9 +88,7 @@ describe('WorkspaceitemsDeletePageComponent', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should have the current WorkspaceItem', () => {
|
it('should have the current WorkspaceItem', () => {
|
||||||
console.log( (component as any).activatedRoute, 'data wsi');
|
|
||||||
(component as any).activatedRoute.data.subscribe((data) => {
|
(component as any).activatedRoute.data.subscribe((data) => {
|
||||||
console.log(data, 'dataaa');
|
|
||||||
expect(data.wsi.payload.id).toEqual('1234');
|
expect(data.wsi.payload.id).toEqual('1234');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -103,7 +101,6 @@ describe('WorkspaceitemsDeletePageComponent', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should call workspaceItemService.delete', () => {
|
it('should call workspaceItemService.delete', () => {
|
||||||
spyOn(workspaceitemDataServiceSpy, 'delete').and.returnValue(observableOf(createSuccessfulRemoteDataObject({})));
|
|
||||||
component.sendDeleteRequest();
|
component.sendDeleteRequest();
|
||||||
expect((component as any).workspaceItemService.delete).toHaveBeenCalledWith('1234');
|
expect((component as any).workspaceItemService.delete).toHaveBeenCalledWith('1234');
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user