add job finished test

This commit is contained in:
Chris Meyers 2017-02-01 16:42:17 -05:00
parent f62b6ca014
commit 8b40cb14ec

View File

@ -99,7 +99,7 @@ describe('Controller: workflowResults', () => {
});
});
describe('job is not running', () => {
describe('job waiting', () => {
beforeEach(() => {
jobWaitingWorkflowResultsControllerFixture(null, 'waiting');
});
@ -109,6 +109,16 @@ describe('Controller: workflowResults', () => {
});
});
describe('job finished', () => {
beforeEach(() => {
jobWaitingWorkflowResultsControllerFixture(moment(), 'successful');
});
it('should start elapsed timer', () => {
expect(workflowResultsService.createOneSecondTimer).not.toHaveBeenCalled();
});
});
});
describe('job transitions to running', () => {
@ -122,17 +132,5 @@ describe('Controller: workflowResults', () => {
expect(workflowResultsService.createOneSecondTimer).toHaveBeenCalled();
});
});
describe('job finished', () => {
beforeEach(() => {
jobWaitingWorkflowResultsControllerFixture(null, 'waiting');
$rootScope.$broadcast('ws-jobs', { unified_job_id: workflow_job_json.id, status: "running" });
});
it('should start elapsed timer', () => {
expect(scope.workflow.status).toBe("running");
expect(workflowResultsService.createOneSecondTimer).toHaveBeenCalled();
});
});
});
});