[CSTPER-3620] Workflow Actions refresh entire MyDSpace page instead of just WorkflowItem

Failing tests in CI environment refactored
This commit is contained in:
Alessandro Martelli
2020-12-22 18:20:22 +01:00
parent b80282c243
commit 5700450eec
2 changed files with 18 additions and 15 deletions

View File

@@ -102,18 +102,22 @@ describe('ClaimedTaskActionsApproveComponent', () => {
it('should start the action execution', () => {
expect(component.startActionExecution).toHaveBeenCalled();
});
});
describe('actionExecution', () => {
beforeEach(() => {
component.actionExecution().subscribe();
fixture.detectChanges();
it('should call claimedTaskService\'s submitTask', (done) => {
const expectedBody = {
[component.option]: 'true'
};
component.actionExecution().subscribe(() => {
expect(claimedTaskService.submitTask).toHaveBeenCalledWith(object.id, expectedBody);
done();
});
});
it('should call claimedTaskService\'s submitTask', () => {
expect(claimedTaskService.submitTask).toHaveBeenCalledWith(object.id, expectedBody)
});
});
});
describe('reloadObjectExecution', () => {

View File

@@ -151,18 +151,17 @@ describe('ClaimedTaskActionsRejectComponent', () => {
beforeEach(() => {
spyOn((component.rejectForm as any), 'get').and.returnValue({value: 'required'});
expectedBody = {
[component.option]: 'true',
reason: 'required'
};
component.actionExecution().subscribe();
fixture.detectChanges();
});
it('should call claimedTaskService\'s submitTask with the proper reason', () => {
expect(claimedTaskService.submitTask).toHaveBeenCalledWith(object.id, expectedBody)
it('should call claimedTaskService\'s submitTask with the proper reason', (done) => {
component.actionExecution().subscribe(() => {
expect(claimedTaskService.submitTask).toHaveBeenCalledWith(object.id, expectedBody);
done();
});
});
});