breaking: remove socket.emit('posts.bookmark/unbookmark')

This commit is contained in:
Barış Soner Uşaklı
2021-12-09 17:59:23 -05:00
parent 16c88a977c
commit f7418ccd47
3 changed files with 10 additions and 37 deletions

View File

@@ -282,28 +282,18 @@ describe('Post\'s', () => {
});
describe('bookmarking', () => {
it('should bookmark a post', (done) => {
socketPosts.bookmark({ uid: voterUid }, { pid: postData.pid, room_id: `topic_${postData.tid}` }, (err, data) => {
assert.ifError(err);
assert.equal(data.isBookmarked, true);
posts.hasBookmarked(postData.pid, voterUid, (err, hasBookmarked) => {
assert.ifError(err);
assert.equal(hasBookmarked, true);
done();
});
});
it('should bookmark a post', async () => {
const data = await apiPosts.bookmark({ uid: voterUid }, { pid: postData.pid, room_id: `topic_${postData.tid}` });
assert.equal(data.isBookmarked, true);
const hasBookmarked = await posts.hasBookmarked(postData.pid, voterUid);
assert.equal(hasBookmarked, true);
});
it('should unbookmark a post', (done) => {
socketPosts.unbookmark({ uid: voterUid }, { pid: postData.pid, room_id: `topic_${postData.tid}` }, (err, data) => {
assert.ifError(err);
assert.equal(data.isBookmarked, false);
posts.hasBookmarked([postData.pid], voterUid, (err, hasBookmarked) => {
assert.ifError(err);
assert.equal(hasBookmarked[0], false);
done();
});
});
it('should unbookmark a post', async () => {
const data = await apiPosts.unbookmark({ uid: voterUid }, { pid: postData.pid, room_id: `topic_${postData.tid}` });
assert.equal(data.isBookmarked, false);
const hasBookmarked = await posts.hasBookmarked([postData.pid], voterUid);
assert.equal(hasBookmarked[0], false);
});
});