fixing unit test failures

This commit is contained in:
jaredevantabor 2017-01-26 10:43:18 -08:00
parent 38f4a413d7
commit bad9e9fcf0
2 changed files with 4 additions and 2 deletions

View File

@ -110,7 +110,7 @@ function(jobData, jobDataOptions, jobLabels, jobFinished, count, $scope, ParseTy
$scope.hideTraceback = false;
toDestroy.push($scope.$watch('job.job_explanation', function(explanation) {
if (explanation.split(":")[0] === "Previous Task Failed") {
if (explanation && explanation.split(":")[0] === "Previous Task Failed") {
$scope.previousTaskFailed = true;
var taskObj = JSON.parse(explanation.substring(explanation.split(":")[0].length + 1));
// return a promise from the options request with the permission type choices (including adhoc) as a param

View File

@ -4,7 +4,7 @@ describe('Controller: jobResultsController', () => {
// Setup
let jobResultsController;
let jobData, jobDataOptions, jobLabels, jobFinished, count, $scope, ParseTypeChange, ParseVariableString, jobResultsService, eventQueue, $compile, eventResolve, populateResolve, $rScope, q, $log, Dataset, Rest, $state, QuerySet, i18n;
let jobData, jobDataOptions, jobLabels, jobFinished, count, $scope, ParseTypeChange, ParseVariableString, jobResultsService, eventQueue, $compile, eventResolve, populateResolve, $rScope, q, $log, Dataset, Rest, $state, QuerySet, i18n,fieldChoices, fieldLabels;
jobData = {
related: {}
@ -78,6 +78,8 @@ describe('Controller: jobResultsController', () => {
$provide.value('$state', $state);
$provide.value('QuerySet', QuerySet);
$provide.value('i18n', i18n);
$provide.value('fieldChoices', fieldChoices);
$provide.value('fieldLabels', fieldLabels);
});
};