69115: ClaimedTaskDataService and components refactoring

This commit is contained in:
Kristof De Langhe
2020-02-27 13:45:54 +01:00
parent 18b9a41fe0
commit b9c050c19c
17 changed files with 169 additions and 118 deletions

View File

@@ -52,8 +52,7 @@ describe('ClaimedTaskDataService', () => {
options.headers = headers;
});
describe('approveTask', () => {
describe('submitTask', () => {
it('should call postToEndpoint method', () => {
const scopeId = '1234';
const body = {
@@ -63,33 +62,13 @@ describe('ClaimedTaskDataService', () => {
spyOn(service, 'postToEndpoint');
requestService.uriEncodeBody.and.returnValue(body);
service.approveTask(scopeId);
expect(service.postToEndpoint).toHaveBeenCalledWith(linkPath, body, scopeId, options);
});
});
describe('rejectTask', () => {
it('should call postToEndpoint method', () => {
const scopeId = '1234';
const reason = 'test reject';
const body = {
submit_reject: 'true',
reason
};
spyOn(service, 'postToEndpoint');
requestService.uriEncodeBody.and.returnValue(body);
service.rejectTask(reason, scopeId);
service.submitTask(scopeId, body);
expect(service.postToEndpoint).toHaveBeenCalledWith(linkPath, body, scopeId, options);
});
});
describe('returnToPoolTask', () => {
it('should call deleteById method', () => {
const scopeId = '1234';