mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 01:47:35 -02:30
add job finished test
This commit is contained in:
@@ -99,7 +99,7 @@ describe('Controller: workflowResults', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('job is not running', () => {
|
describe('job waiting', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
jobWaitingWorkflowResultsControllerFixture(null, 'waiting');
|
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', () => {
|
describe('job transitions to running', () => {
|
||||||
@@ -122,17 +132,5 @@ describe('Controller: workflowResults', () => {
|
|||||||
expect(workflowResultsService.createOneSecondTimer).toHaveBeenCalled();
|
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();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
Reference in New Issue
Block a user