[Timelines] Test metadata columns in CSV Export

...and additionally refactor to run in a test environment
(don't use Array.prototype.find)
This commit is contained in:
Victor Woeltjen
2016-03-08 09:56:21 -08:00
parent dd66cb60d8
commit ed679756b3
2 changed files with 81 additions and 5 deletions

View File

@@ -34,11 +34,11 @@ define([], function () {
MetadataColumn.prototype.value = function (domainObject) {
var properties = domainObject.useCapability('metadata'),
name = this.propertyName,
property = properties.find(function (p) {
return p.name === name;
});
return property ? property.value : "";
name = this.propertyName;
return properties.reduce(function (value, property) {
return property.name === name ?
property.value : value;
}, "");
};
return MetadataColumn;