mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
feat: add test for change post owner
This commit is contained in:
@@ -142,6 +142,14 @@ describe('Post\'s', function () {
|
||||
}
|
||||
});
|
||||
|
||||
it('should fail to change owner if user is not authorized', async function () {
|
||||
try {
|
||||
await socketPosts.changeOwner({ uid: voterUid }, { pids: [1, 2], toUid: voterUid });
|
||||
} catch (err) {
|
||||
assert.strictEqual(err.message, '[[error:no-privileges]]');
|
||||
}
|
||||
});
|
||||
|
||||
it('should return falsy if post does not exist', function (done) {
|
||||
posts.getPostData(9999, function (err, postData) {
|
||||
assert.ifError(err);
|
||||
|
||||
Reference in New Issue
Block a user