feat: edit test

v1.18.x
Barış Soner Uşaklı 5 years ago
parent e72fe25920
commit ccddbb15c9

@ -554,15 +554,20 @@ describe('Post\'s', function () {
}); });
}); });
it('should edit post', function (done) { it('should edit post', async function () {
socketPosts.edit({ uid: voterUid }, { pid: pid, content: 'edited post content', title: 'edited title', tags: ['edited'] }, function (err, data) { const data = await socketPosts.edit({ uid: voterUid }, {
assert.ifError(err); pid: pid,
assert.equal(data.content, 'edited post content'); content: 'edited post content',
assert.equal(data.editor, voterUid); title: 'edited title',
assert.equal(data.topic.title, 'edited title'); tags: ['edited'],
assert.equal(data.topic.tags[0].value, 'edited');
done();
}); });
assert.strictEqual(data.content, 'edited post content');
assert.strictEqual(data.editor, voterUid);
assert.strictEqual(data.topic.title, 'edited title');
assert.strictEqual(data.topic.tags[0].value, 'edited');
const res = await db.getObject('post:' + pid);
assert(!res.hasOwnProperty('bookmarks'));
}); });
it('should disallow post editing for new users if post was made past the threshold for editing', function (done) { it('should disallow post editing for new users if post was made past the threshold for editing', function (done) {

Loading…
Cancel
Save