mirror of
https://github.com/ansible/awx.git
synced 2026-03-06 11:11:07 -03:30
more unit test code that doens't work and fixing jshint
This commit is contained in:
@@ -463,7 +463,7 @@ function(jobData, jobDataOptions, jobLabels, jobFinished, count, $scope, ParseTy
|
|||||||
// correct anything that was out of sync from the job run
|
// correct anything that was out of sync from the job run
|
||||||
jobResultsService.getJobData($scope.job.id).then(function(data){
|
jobResultsService.getJobData($scope.job.id).then(function(data){
|
||||||
$scope.job = data;
|
$scope.job = data;
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
} else if (parseInt(data.project_id, 10) ===
|
} else if (parseInt(data.project_id, 10) ===
|
||||||
parseInt($scope.job.project,10)) {
|
parseInt($scope.job.project,10)) {
|
||||||
|
|||||||
@@ -5,7 +5,8 @@
|
|||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
|
|
||||||
export default ['$q', 'Prompt', '$filter', 'Wait', 'Rest', '$state', 'ProcessErrors', 'InitiatePlaybookRun', 'GetBasePath', function ($q, Prompt, $filter, Wait, Rest, $state, ProcessErrors, InitiatePlaybookRun, GetBasePath) {
|
export default ['$q', 'Prompt', '$filter', 'Wait', 'Rest', '$state', 'ProcessErrors', 'InitiatePlaybookRun', 'GetBasePath', 'Alert',
|
||||||
|
function ($q, Prompt, $filter, Wait, Rest, $state, ProcessErrors, InitiatePlaybookRun, GetBasePath, Alert) {
|
||||||
var val = {
|
var val = {
|
||||||
// the playbook_on_stats event returns the count data in a weird format.
|
// the playbook_on_stats event returns the count data in a weird format.
|
||||||
// format to what we need!
|
// format to what we need!
|
||||||
|
|||||||
@@ -29,8 +29,6 @@ describe('Controller: jobResultsController', () => {
|
|||||||
data: {foo: "bar"}
|
data: {foo: "bar"}
|
||||||
};
|
};
|
||||||
|
|
||||||
moment = function(){};
|
|
||||||
|
|
||||||
let provideVals = () => {
|
let provideVals = () => {
|
||||||
angular.mock.module('jobResults', ($provide) => {
|
angular.mock.module('jobResults', ($provide) => {
|
||||||
ParseTypeChange = jasmine.createSpy('ParseTypeChange');
|
ParseTypeChange = jasmine.createSpy('ParseTypeChange');
|
||||||
@@ -60,10 +58,15 @@ describe('Controller: jobResultsController', () => {
|
|||||||
'encodeQueryset'
|
'encodeQueryset'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
moment = jasmine.createSpyObj('moment', [
|
moment = jasmine.createSpyObj('momentStub', [
|
||||||
'diff'
|
'diff'
|
||||||
]);
|
]);
|
||||||
|
spyOn(window, 'moment').andReturn(momentStub);
|
||||||
|
// spyOn(window, 'moment').and.callFake(function (date) {
|
||||||
|
// return {
|
||||||
|
// diff: function (diff) { /* your format implementation */ }
|
||||||
|
// };
|
||||||
|
// });
|
||||||
$provide.value('jobData', jobData);
|
$provide.value('jobData', jobData);
|
||||||
$provide.value('jobDataOptions', jobDataOptions);
|
$provide.value('jobDataOptions', jobDataOptions);
|
||||||
$provide.value('jobLabels', jobLabels);
|
$provide.value('jobLabels', jobLabels);
|
||||||
|
|||||||
Reference in New Issue
Block a user