Skip to content

Commit

Permalink
test(edit-list-item): add mock api response to fix failing test (#759)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdelez committed Jun 7, 2022
1 parent 172eeb0 commit effdd5d
Showing 1 changed file with 11 additions and 0 deletions.
Expand Up @@ -7,6 +7,7 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import {
ApiResponseData,
CreateChildNodeRequest,
DeleteChildNodeCommentsResponse,
ListNodeInfoResponse,
ListsEndpointAdmin,
MockProjects,
Expand Down Expand Up @@ -234,6 +235,16 @@ describe('EditListItemComponent', () => {
}
);

(dspConnSpy.admin.listsEndpoint as jasmine.SpyObj<ListsEndpointAdmin>).deleteChildComments.and.callFake(
() => {
const response = new DeleteChildNodeCommentsResponse();
response.commentsDeleted = true;
response.nodeIri = 'http://rdfh.ch/lists/0001/otherTreeList01';

return of(ApiResponseData.fromAjaxResponse({ response } as AjaxResponse));
}
);

const updateChildNodeRequest: UpdateChildNodeRequest = new UpdateChildNodeRequest();
updateChildNodeRequest.projectIri = testHostComponent.editListItem.projectIri;
updateChildNodeRequest.listIri = testHostComponent.editListItem.iri;
Expand Down

0 comments on commit effdd5d

Please sign in to comment.