mirror of
https://github.com/ansible/awx.git
synced 2026-03-01 08:48:46 -03:30
fix tests
This commit is contained in:
@@ -665,7 +665,7 @@ function(jobData, jobDataOptions, jobLabels, jobFinished, count, $scope, ParseTy
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
// get previously set up socket messages from resolve
|
// get previously set up socket messages from resolve
|
||||||
if (statusSocket[0].job_status) {
|
if (statusSocket && statusSocket[0] && statusSocket[0].job_status) {
|
||||||
$scope.job_status = statusSocket[0].job_status;
|
$scope.job_status = statusSocket[0].job_status;
|
||||||
}
|
}
|
||||||
if ($scope.job_status === "running" && !$scope.job.elapsed) {
|
if ($scope.job_status === "running" && !$scope.job.elapsed) {
|
||||||
@@ -709,10 +709,12 @@ function(jobData, jobDataOptions, jobLabels, jobFinished, count, $scope, ParseTy
|
|||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
statusSocket[1]();
|
if (statusSocket && statusSocket[1]) {
|
||||||
|
statusSocket[1]();
|
||||||
|
}
|
||||||
|
|
||||||
$scope.$on('$destroy', function(){
|
$scope.$on('$destroy', function(){
|
||||||
if (statusSocket[1]) {
|
if (statusSocket && statusSocket[1]) {
|
||||||
statusSocket[1]();
|
statusSocket[1]();
|
||||||
}
|
}
|
||||||
$( ".JobResultsStdOut-aLineOfStdOut" ).remove();
|
$( ".JobResultsStdOut-aLineOfStdOut" ).remove();
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ module.exports = function(config) {
|
|||||||
frameworks: [
|
frameworks: [
|
||||||
'jasmine',
|
'jasmine',
|
||||||
],
|
],
|
||||||
reporters: ['progress', 'coverage', 'junit'],
|
reporters: ['progress', 'coverage'],
|
||||||
files: [
|
files: [
|
||||||
'./client/src/app.js',
|
'./client/src/app.js',
|
||||||
'./node_modules/angular-mocks/angular-mocks.js',
|
'./node_modules/angular-mocks/angular-mocks.js',
|
||||||
|
|||||||
@@ -7,6 +7,10 @@ describe('Controller: jobResultsController', () => {
|
|||||||
|
|
||||||
let jobData, jobDataOptions, jobLabels, jobFinished, count, $scope, ParseTypeChange, ParseVariableString, jobResultsService, eventQueue, $compile, eventResolve, populateResolve, $rScope, q, $log, Dataset, Rest, $state, QuerySet, i18n,fieldChoices, fieldLabels, $interval, workflowResultsService, statusSocket;
|
let jobData, jobDataOptions, jobLabels, jobFinished, count, $scope, ParseTypeChange, ParseVariableString, jobResultsService, eventQueue, $compile, eventResolve, populateResolve, $rScope, q, $log, Dataset, Rest, $state, QuerySet, i18n,fieldChoices, fieldLabels, $interval, workflowResultsService, statusSocket;
|
||||||
|
|
||||||
|
statusSocket = function() {
|
||||||
|
var fn = function() {};
|
||||||
|
return fn;
|
||||||
|
}
|
||||||
jobData = {
|
jobData = {
|
||||||
related: {}
|
related: {}
|
||||||
};
|
};
|
||||||
@@ -70,6 +74,8 @@ describe('Controller: jobResultsController', () => {
|
|||||||
return jasmine.createSpyObj('workflowResultsService', ['createOneSecondTimer', 'destroyTimer']);
|
return jasmine.createSpyObj('workflowResultsService', ['createOneSecondTimer', 'destroyTimer']);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$provide.value('statusSocket', statusSocket);
|
||||||
|
|
||||||
$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