Merge branch 'open-master' into mobile

Merge in latest from master branch into mobile branch
This commit is contained in:
Victor Woeltjen
2015-09-17 16:40:48 -07:00
15 changed files with 382 additions and 104 deletions

View File

@@ -67,8 +67,9 @@ define(
function packageCapabilities(capabilities) {
var result = {};
capabilities.forEach(function (capability) {
if (capability.key && !result[capability.key]) {
result[capability.key] = capability;
if (capability.key) {
result[capability.key] =
result[capability.key] || capability;
} else {
$log.warn("No key defined for capability; skipping.");
}

View File

@@ -78,10 +78,6 @@ define(
{
name: "Type",
value: type && type.getName()
},
{
name: "ID",
value: domainObject.getId()
}
];
}

View File

@@ -86,7 +86,19 @@ define(
expect(mockLog.warn).not.toHaveBeenCalled();
});
it("prefers higher-priority capability", function () {
KeylessCapability.key = BasicCapability.key;
expect(provider.getCapabilities({}).basic)
.toEqual(BasicCapability);
});
// https://github.com/nasa/openmctweb/issues/49
it("does not log a warning for multiple capabilities with the same key", function () {
KeylessCapability.key = BasicCapability.key;
provider.getCapabilities({});
expect(mockLog.warn).not.toHaveBeenCalled();
});
});
}
);
);

View File

@@ -92,7 +92,6 @@ define(
it("reports generic properties", function () {
var properties = metadata.invoke();
expect(findValue(properties, 'ID')).toEqual("Test id");
expect(findValue(properties, 'Type')).toEqual("Test type");
});