asimov-deploy-ui
Advanced tools
Comparing version 0.9.6 to 0.9.7
@@ -69,3 +69,3 @@ /******************************************************************************* | ||
agents = _.filter(agents, function (agent) { | ||
return _.filter(agent.groups, function (g) { | ||
return _.find(agent.groups, function (g) { | ||
return filters.agentGroups.indexOf(g) !== -1; | ||
@@ -72,0 +72,0 @@ }); |
@@ -5,3 +5,3 @@ { | ||
"author": "Ebay Inc", | ||
"version": "0.9.6", | ||
"version": "0.9.7", | ||
"homepage": "https://github.com/asimov-deploy/asimov-deploy", | ||
@@ -8,0 +8,0 @@ "license": "Apache-2.0", |
@@ -51,3 +51,3 @@ require('should'); | ||
var unitListForAgentGroup = []; | ||
var fakeAgent = { group: "groupName" }; | ||
var fakeAgent = { groups: [ "groupName" ] }; | ||
var expectedUnitList = []; | ||
@@ -95,3 +95,3 @@ | ||
var unitList = []; | ||
var fakeAgent = { group: "groupName", isLegacyNodeAgent: false }; | ||
var fakeAgent = { groups: ["groupName"], isLegacyNodeAgent: false }; | ||
var jsonClientOptions; | ||
@@ -133,3 +133,3 @@ var jsonClientGetSpy; | ||
var unitList = []; | ||
var fakeAgent = { group: "groupName", isLegacyNodeAgent: true }; | ||
var fakeAgent = { groups: ["groupName"], isLegacyNodeAgent: true }; | ||
var jsonClientOptions; | ||
@@ -171,3 +171,3 @@ var jsonClientGetSpy; | ||
var unitList = []; | ||
var fakeAgent = { group: "groupName", supportsFiltering: true }; | ||
var fakeAgent = { groups: ["groupName"], supportsFiltering: true }; | ||
var jsonClientOptions; | ||
@@ -209,3 +209,3 @@ var jsonClientGetSpy; | ||
var unitList = []; | ||
var fakeAgent = { group: "groupName", supportsFiltering: false }; | ||
var fakeAgent = { groups: ["groupName"], supportsFiltering: false }; | ||
var jsonClientOptions; | ||
@@ -247,2 +247,55 @@ var jsonClientGetSpy; | ||
}); | ||
describe('when multiple agents registered', function() { | ||
var unitListForAgentGroupOne = [ | ||
{ | ||
name: "test" | ||
} | ||
]; | ||
var fakeAgentOne = { groups: ["group1", "group2"] }; | ||
var fakeAgentTwo = { groups: ["group3"] }; | ||
var expectedUnitList = [ | ||
{ | ||
agent: fakeAgentOne, | ||
units: [ | ||
{ | ||
name: "test" | ||
} | ||
] | ||
} | ||
]; | ||
before(function() { | ||
var fakeConfig = { | ||
agents: [ | ||
fakeAgentOne, | ||
fakeAgentTwo | ||
], | ||
getAgent: function() { | ||
return { url: 'agentUrl', apiKey: '12321313213' }; | ||
} | ||
}; | ||
var restify = { | ||
createJsonClient: function() { | ||
return { | ||
get: function(url, cb) { | ||
cb(null,null,null,unitListForAgentGroupOne); | ||
} | ||
}; | ||
} | ||
}; | ||
var apiClient = require("../../app/services/agent-api-client").create(fakeConfig, restify); | ||
apiClient.getUnits({agentGroups: ['group1']}, false, function(results) { | ||
unitListForAgentGroupOne = results; | ||
}); | ||
}); | ||
it('should return units for agent one)', function() { | ||
unitListForAgentGroupOne.should.deepEqual(expectedUnitList); | ||
}); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3407620
71389