fix category-row regressions

This commit is contained in:
Joffrey JAFFEUX 2018-03-27 14:11:05 +02:00 committed by GitHub
parent ff9d7a9bfb
commit 15aa712227
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -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 ? '…' : ''}`;
}
}
});

View File

@ -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);
});