mirror of
https://github.com/ansible/awx.git
synced 2026-03-10 05:59:28 -02:30
Fix failing tests
This commit is contained in:
@@ -40,7 +40,7 @@ function HostCountGraphData(Rest, getBasePath, processErrors, $q) {
|
|||||||
processErrors(null, response.data, response.status, null, { hdr: 'Error!',
|
processErrors(null, response.data, response.status, null, { hdr: 'Error!',
|
||||||
msg: errorMessage
|
msg: errorMessage
|
||||||
});
|
});
|
||||||
throw response;
|
return $q.reject(response);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -4,9 +4,10 @@ angular.module('DataServices')
|
|||||||
"GetBasePath",
|
"GetBasePath",
|
||||||
"ProcessErrors",
|
"ProcessErrors",
|
||||||
"$rootScope",
|
"$rootScope",
|
||||||
|
"$q",
|
||||||
JobStatusGraphData]);
|
JobStatusGraphData]);
|
||||||
|
|
||||||
function JobStatusGraphData(Rest, getBasePath, processErrors, $rootScope) {
|
function JobStatusGraphData(Rest, getBasePath, processErrors, $rootScope, $q) {
|
||||||
|
|
||||||
function pluck(property, promise) {
|
function pluck(property, promise) {
|
||||||
return promise.then(function(value) {
|
return promise.then(function(value) {
|
||||||
@@ -28,7 +29,7 @@ function JobStatusGraphData(Rest, getBasePath, processErrors, $rootScope) {
|
|||||||
hdr: 'Error!',
|
hdr: 'Error!',
|
||||||
msg: errorMessage
|
msg: errorMessage
|
||||||
});
|
});
|
||||||
throw response;
|
return $q.reject(response);
|
||||||
});
|
});
|
||||||
|
|
||||||
return pluck('data', result);
|
return pluck('data', result);
|
||||||
|
|||||||
@@ -51,11 +51,10 @@ module.exports = function(config) {
|
|||||||
'../static/lib/lrInfiniteScroll/lrInfiniteScroll.js',
|
'../static/lib/lrInfiniteScroll/lrInfiniteScroll.js',
|
||||||
'../static/lib/ansible/*.js',
|
'../static/lib/ansible/*.js',
|
||||||
'../static/js/config.js',
|
'../static/js/config.js',
|
||||||
'../static/js/directives/dashboard-graphs.js',
|
'../static/js/directives/_dashboard-graphs.js',
|
||||||
'../static/js/*/*.js',
|
'../static/js/*/*.js',
|
||||||
'../static/js/app.js',
|
'../static/js/app.js',
|
||||||
'../static/lib/angular-mocks/angular-mocks.js',
|
'../static/lib/angular-mocks/angular-mocks.js',
|
||||||
'../../../node_modules/ng-midway-tester/src/ngMidwayTester.js',
|
|
||||||
'./unit/*',
|
'./unit/*',
|
||||||
'./unit/**/*'
|
'./unit/**/*'
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ describe('Host Count Graph Data Service', function() {
|
|||||||
window.setTimeout(function() {
|
window.setTimeout(function() {
|
||||||
inject(function($rootScope) {
|
inject(function($rootScope) {
|
||||||
$rootScope.$apply();
|
$rootScope.$apply();
|
||||||
});
|
}, 1000);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,6 +74,7 @@ describe('Host Count Graph Data Service', function() {
|
|||||||
|
|
||||||
$provide.value("$cookieStore", { get: angular.noop });
|
$provide.value("$cookieStore", { get: angular.noop });
|
||||||
|
|
||||||
|
$provide.value('ProcessErrors', processErrors);
|
||||||
$provide.value('Rest', restStub);
|
$provide.value('Rest', restStub);
|
||||||
$provide.value('GetBasePath', getBasePath);
|
$provide.value('GetBasePath', getBasePath);
|
||||||
}));
|
}));
|
||||||
|
|||||||
Reference in New Issue
Block a user