diff --git a/src/components/task.vue b/src/components/task.vue index a130051d6..f97cdbf2d 100644 --- a/src/components/task.vue +++ b/src/components/task.vue @@ -326,8 +326,8 @@ export default { } this.taskId = task.id; this.nodeId = task.element_id; - } else { - this.$emit('completed', (this.parentRequest ? this.parentRequest : requestId)); + } else if (this.parentRequest) { + this.$emit('completed', this.parentRequest); } }); }, diff --git a/tests/e2e/specs/Task.spec.js b/tests/e2e/specs/Task.spec.js index b62978298..95d50f30d 100644 --- a/tests/e2e/specs/Task.spec.js +++ b/tests/e2e/specs/Task.spec.js @@ -561,8 +561,11 @@ describe('Task component', () => { getTasks('http://localhost:8080/api/1.0/tasks?user_id=1&status=ACTIVE&process_request_id=1&include_sub_tasks=1'); - cy.wait(2000); - cy.reload(); + }); + + cy.socketEvent('ProcessMaker\\Events\\ProcessUpdated', { + requestId: 1, + event: 'ACTIVITY_COMPLETED', }); cy.url().should('eq', 'http://localhost:8080/requests/1');