-
Notifications
You must be signed in to change notification settings - Fork 903
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core/pipeline): Support grouping stages that have a 'group' prop…
…erty (#4117)
- Loading branch information
Justin Reynolds
authored
Sep 20, 2017
1 parent
9c37668
commit c4b0057
Showing
40 changed files
with
948 additions
and
416 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
194 changes: 0 additions & 194 deletions
194
app/scripts/modules/core/src/delivery/details/executionDetails.controller.js
This file was deleted.
Oops, something went wrong.
65 changes: 0 additions & 65 deletions
65
app/scripts/modules/core/src/delivery/details/executionDetails.controller.spec.js
This file was deleted.
Oops, something went wrong.
58 changes: 58 additions & 0 deletions
58
app/scripts/modules/core/src/delivery/details/executionDetails.controller.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import { IControllerService, IRootScopeService, IScope, auto, mock } from 'angular'; | ||
import { EXECUTION_DETAILS_CONTROLLER, ExecutionDetailsController } from './executionDetails.controller'; | ||
|
||
import { IStage } from 'core/domain'; | ||
|
||
describe('Controller: ExecutionDetails', () => { | ||
let $scope: IScope; | ||
let controller: ExecutionDetailsController; | ||
let pipelineConfig: any; | ||
|
||
beforeEach(mock.module( | ||
EXECUTION_DETAILS_CONTROLLER, | ||
($provide: auto.IProvideService) => { | ||
$provide.service('pipelineConfig', () => { | ||
return { getStageConfig: (stage: IStage) => stage }; | ||
}); | ||
} | ||
)); | ||
|
||
beforeEach(mock.inject(($controller: IControllerService, | ||
$rootScope: IRootScopeService, | ||
_pipelineConfig_: any) => { | ||
$scope = $rootScope.$new(); | ||
controller = $controller(ExecutionDetailsController, { | ||
$scope: $scope | ||
}); | ||
controller.execution = { isRunning: false } as any; | ||
controller.application = { attributes: { enableRestartRunningExecutions: false } } as any; | ||
|
||
pipelineConfig = _pipelineConfig_; | ||
})); | ||
|
||
describe('isRestartable', () => { | ||
it('returns false when no stage config', () => { | ||
expect(controller.isRestartable()).toBe(false); | ||
}); | ||
|
||
it('returns false when stage is not restartable', () => { | ||
expect(controller.isRestartable({restartable: false} as any)).toBe(false); | ||
}); | ||
|
||
it('returns false when stage is already restarting', () => { | ||
expect(controller.isRestartable({restartable: true, isRestarting: true} as any)).toBe(false); | ||
}); | ||
|
||
it('returns true when stage is restartable', () => { | ||
expect(controller.isRestartable({restartable: true} as any)).toBe(true); | ||
}); | ||
|
||
it('returns true when stage is running, is restartable and enableRestartRunningExecutions=true', () => { | ||
controller.execution.isRunning = true; | ||
controller.application.attributes.enableRestartRunningExecutions = true; | ||
$scope.$digest(); | ||
expect(controller.isRestartable({restartable: true} as any)).toBe(true); | ||
}); | ||
}); | ||
|
||
}); |
Oops, something went wrong.