A platform for community discussion. Free, open, simple.
fix category-row regressions
Joffrey JAFFEUX15aa7122277c
diff --git a/app/assets/javascripts/select-kit/components/category-row.js.es6 b/app/assets/javascripts/select-kit/components/category-row.js.es6index 2f52887b989..74f146e51c7 100644--- a/app/assets/javascripts/select-kit/components/category-row.js.es6+++ b/app/assets/javascripts/select-kit/components/category-row.js.es6@@ -82,6 +82,8 @@ export default SelectKitRowComponent.extend({@computed("category.description")description(description) {- return `${description.substr(0, 200)}${description.length > 200 ? '…' : ''}`;+ if (description) {+ return `${description.substr(0, 200)}${description.length > 200 ? '…' : ''}`;+ }}});diff --git a/test/javascripts/components/category-chooser-test.js.es6 b/test/javascripts/components/category-chooser-test.js.es6index bb129c872bd..ad94f675b0c 100644--- a/test/javascripts/components/category-chooser-test.js.es6+++ b/test/javascripts/components/category-chooser-test.js.es6@@ -35,9 +35,9 @@ componentTest('with scopedCategoryId', {this.get('subject').expand();andThen(() => {- assert.equal(this.get('subject').rowByIndex(0).title(), 'feature');+ assert.equal(this.get('subject').rowByIndex(0).title(), 'Discussion about features or potential features of Discourse: how they work, why they work, etc.');assert.equal(this.get('subject').rowByIndex(0).value(), 2);- assert.equal(this.get('subject').rowByIndex(1).title(), 'spec');+ assert.equal(this.get('subject').rowByIndex(1).title(), 'My idea here is to have mini specs for features we would like built but have no bandwidth to build');assert.equal(this.get('subject').rowByIndex(1).value(), 26);assert.equal(this.get('subject').rows().length, 2);});