Commit 2224dc0f authored by Jacky Hu's avatar Jacky Hu

Fix npm test

Change-Id: I5fecf6a557558b11a7c1abcd25ffbffcd27f31ce
parent 8b7bb910
......@@ -57,11 +57,13 @@ module.exports = function (config) {
toxPath + 'xstatic/pkg/angular/data/angular-cookies.js',
toxPath + 'xstatic/pkg/angular_bootstrap/data/angular-bootstrap.js',
toxPath + 'xstatic/pkg/angular_gettext/data/angular-gettext.js',
toxPath + 'xstatic/pkg/angular_fileupload/data/ng-file-upload-all.js',
toxPath + 'xstatic/pkg/angular/data/angular-sanitize.js',
toxPath + 'xstatic/pkg/d3/data/d3.js',
toxPath + 'xstatic/pkg/rickshaw/data/rickshaw.js',
toxPath + 'xstatic/pkg/angular_smart_table/data/smart-table.js',
toxPath + 'xstatic/pkg/angular_lrdragndrop/data/lrdragndrop.js',
toxPath + 'xstatic/pkg/angular_schema_form/data/schema-form.js',
toxPath + 'xstatic/pkg/spin/data/spin.js',
toxPath + 'xstatic/pkg/spin/data/spin.jquery.js',
......
......@@ -37,16 +37,16 @@
var tests = [
{
"func": "getCertificates",
"method": "get",
"path": "/api/barbican/certificates/",
"error": "Unable to retrieve SSL certificates."
func: "getCertificates",
method: "get",
path: "/api/barbican/certificates/",
error: "Unable to retrieve SSL certificates."
},
{
"func": "getSecrets",
"method": "get",
"path": "/api/barbican/secrets/",
"error": "Unable to retrieve secrets."
func: "getSecrets",
method: "get",
path: "/api/barbican/secrets/",
error: "Unable to retrieve secrets."
}
];
......
......@@ -164,7 +164,7 @@
*/
function getListeners(id) {
var params = id ? {'params': {'loadbalancerId': id}} : {};
var params = id ? {params: {loadbalancerId: id}} : {};
return apiService.get('/api/lbaas/listeners/', params)
.error(function () {
toastService.add('error', gettext('Unable to retrieve listeners.'));
......@@ -183,7 +183,7 @@
function getListener(id, includeChildResources) {
var params = includeChildResources
? {'params': {'includeChildResources': includeChildResources}}
? {params: {includeChildResources: includeChildResources}}
: {};
return apiService.get('/api/lbaas/listeners/' + id + '/', params)
.error(function () {
......@@ -253,7 +253,7 @@
function getPool(id, includeChildResources) {
var params = includeChildResources
? {'params': {'includeChildResources': includeChildResources}}
? {params: {includeChildResources: includeChildResources}}
: {};
return apiService.get('/api/lbaas/pools/' + id + '/', params)
.error(function () {
......
......@@ -38,18 +38,18 @@
function loadBalancersService($q, api, gettext) {
var operatingStatus = {
'ONLINE': gettext('Online'),
'OFFLINE': gettext('Offline'),
'DEGRADED': gettext('Degraded'),
'ERROR': gettext('Error')
ONLINE: gettext('Online'),
OFFLINE: gettext('Offline'),
DEGRADED: gettext('Degraded'),
ERROR: gettext('Error')
};
var provisioningStatus = {
'ACTIVE': gettext('Active'),
'PENDING_CREATE': gettext('Pending Create'),
'PENDING_UPDATE': gettext('Pending Update'),
'PENDING_DELETE': gettext('Pending Delete'),
'ERROR': gettext('Error')
ACTIVE: gettext('Active'),
PENDING_CREATE: gettext('Pending Create'),
PENDING_UPDATE: gettext('Pending Update'),
PENDING_DELETE: gettext('Pending Delete'),
ERROR: gettext('Error')
};
var service = {
......
......@@ -49,9 +49,9 @@
var ctrl = this;
ctrl.loadBalancerAlgorithm = {
'ROUND_ROBIN': gettext('Round Robin'),
'LEAST_CONNECTIONS': gettext('Least Connections'),
'SOURCE_IP': gettext('Source IP')
ROUND_ROBIN: gettext('Round Robin'),
LEAST_CONNECTIONS: gettext('Least Connections'),
SOURCE_IP: gettext('Source IP')
};
ctrl.actions = rowActions.init($routeParams.loadbalancerId, $routeParams.listenerId).actions;
ctrl.membersTabActive = $window.membersTabActive;
......
......@@ -184,15 +184,15 @@
}
var promise = {
'createloadbalancer': initCreateLoadBalancer,
'createlistener': initCreateListener,
'createpool': initCreatePool,
'createmonitor': initCreateMonitor,
'createmembers': initUpdateMemberList,
'editloadbalancer': initEditLoadBalancer,
'editlistener': initEditListener,
'editpool': initEditPool,
'editmonitor': initEditMonitor
createloadbalancer: initCreateLoadBalancer,
createlistener: initCreateListener,
createpool: initCreatePool,
createmonitor: initCreateMonitor,
createmembers: initUpdateMemberList,
editloadbalancer: initEditLoadBalancer,
editlistener: initEditListener,
editpool: initEditPool,
editmonitor: initEditMonitor
}[type](keymanagerPromise);
return promise.then(onInitSuccess, onInitFail);
......@@ -529,7 +529,7 @@
member.address = member.addresses[0];
if (model.spec.pool.protocol) {
member.port = {'HTTP': 80}[model.spec.pool.protocol];
member.port = {HTTP: 80}[model.spec.pool.protocol];
}
});
}
......
......@@ -87,19 +87,19 @@
return deferred.promise;
},
getLoadBalancer: function() {
var loadbalancer = {
id: '1234',
name: 'Load Balancer 1',
vip_address: '1.2.3.4',
vip_subnet_id: 'subnet-1',
description: ''
};
var loadbalancer = {
id: '1234',
name: 'Load Balancer 1',
vip_address: '1.2.3.4',
vip_subnet_id: 'subnet-1',
description: ''
};
var deferred = $q.defer();
deferred.resolve({ data: loadbalancer });
var deferred = $q.defer();
deferred.resolve({ data: loadbalancer });
return deferred.promise;
},
return deferred.promise;
},
getListeners: function() {
var listeners = [
{ id: '1234', name: 'Listener 1', protocol_port: 80 },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment