more unit test code that doens't work and fixing jshint

This commit is contained in:
jaredevantabor 2016-12-19 11:42:48 -08:00
parent 5de93aa05c
commit bd95aebe36
3 changed files with 11 additions and 7 deletions

View File

@ -463,7 +463,7 @@ function(jobData, jobDataOptions, jobLabels, jobFinished, count, $scope, ParseTy
// correct anything that was out of sync from the job run
jobResultsService.getJobData($scope.job.id).then(function(data){
$scope.job = data;
})
});
}
} else if (parseInt(data.project_id, 10) ===
parseInt($scope.job.project,10)) {

View File

@ -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 = {
// the playbook_on_stats event returns the count data in a weird format.
// format to what we need!

View File

@ -29,8 +29,6 @@ describe('Controller: jobResultsController', () => {
data: {foo: "bar"}
};
moment = function(){};
let provideVals = () => {
angular.mock.module('jobResults', ($provide) => {
ParseTypeChange = jasmine.createSpy('ParseTypeChange');
@ -60,10 +58,15 @@ describe('Controller: jobResultsController', () => {
'encodeQueryset'
]);
moment = jasmine.createSpyObj('moment', [
'diff'
moment = jasmine.createSpyObj('momentStub', [
'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('jobDataOptions', jobDataOptions);
$provide.value('jobLabels', jobLabels);