From 91e84433ffe526079c3ef70a7bb07d85a4d866d3 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Fri, 15 Dec 2017 15:45:50 +0800 Subject: [PATCH] Take two at fixing JS tests. --- .../javascripts/select-kit/components/multi-select.js.es6 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/select-kit/components/multi-select.js.es6 b/app/assets/javascripts/select-kit/components/multi-select.js.es6 index 279656145a0..9358d75e619 100644 --- a/app/assets/javascripts/select-kit/components/multi-select.js.es6 +++ b/app/assets/javascripts/select-kit/components/multi-select.js.es6 @@ -193,7 +193,12 @@ export default SelectKitComponent.extend({ @computed("computedValues.[]", "computedContent.[]") selectedComputedContents(computedValues, computedContent) { const selected = []; - computedValues.forEach(v => selected.push(computedContent.findBy("value", v)) ); + + computedValues.forEach(v => { + const value = computedContent.findBy("value", v); + if (value) selected.push(value); + }); + return selected; },