diff --git a/src/topics/create.js b/src/topics/create.js index 0144cd1f0..cb5e190f3 100644 --- a/src/topics/create.js +++ b/src/topics/create.js @@ -36,6 +36,7 @@ module.exports = function (Topics) { isPrivate: false, isAnonymous: false, isUrgent: false, + isResolved: false, }; // added code for sprint 1 // type casting @@ -52,6 +53,11 @@ module.exports = function (Topics) { * @type {boolean} */ topicData.isUrgent = data.isUrgent || false; + // added code for sprint 2 + /** + * @type {boolean} + */ + topicData.isResolved = data.isResolved || false; if (Array.isArray(data.tags) && data.tags.length) { topicData.tags = data.tags.join(','); diff --git a/test/topics.js b/test/topics.js index 0afb106e7..ca71ad403 100644 --- a/test/topics.js +++ b/test/topics.js @@ -426,6 +426,17 @@ describe('Topic\'s', () => { done(); }); }); + + // code for testing sprint 2, ensuring the isResolved attribute for the topic + it('should get the newly added isResolved field for topic', (done) => { + topics.getTopicFields(newTopic.tid, ['isResolved'], (err, data) => { + assert.ifError(err); + assert(Object.keys(data).length === 1); + assert(data.hasOwnProperty('isResolved')); + done(); + }); + }); + describe('.getTopicWithPosts', () => {