mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
feat: edit test
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user