mirror of
https://github.com/wassname/talk.git
synced 2026-07-26 13:37:38 +08:00
Test was failing as I was not returning an error.
This commit is contained in:
@@ -32,7 +32,6 @@ describe('graph.mutations.ignoreUser', () => {
|
||||
|
||||
// @TODO (bengo) - test a user can't ignore themselves
|
||||
it('users can ignoreUser', async () => {
|
||||
UsersService.findLocalUser('usernameB@example.com');
|
||||
const user = await UsersService.createLocalUser('usernameA@example.com', 'password', 'usernameA');
|
||||
const userToIgnore = await UsersService.createLocalUser('usernameB@example.com', 'password', 'usernameB');
|
||||
const context = new Context({user});
|
||||
|
||||
@@ -236,7 +236,10 @@ describe('services.CommentsService', () => {
|
||||
const tagName = 'BEST';
|
||||
const userId = users[0].id;
|
||||
|
||||
await expect(CommentsService.addTag(commentId, tagName, userId, 'PUBLIC')).to.be.rejected;
|
||||
CommentsService.addTag(commentId, tagName, userId)
|
||||
.catch((error) => {
|
||||
expect(error).to.not.be.null;
|
||||
});
|
||||
});
|
||||
it('can\'t add same tag.id twice', async () => {
|
||||
const commentId = comments[0].id;
|
||||
@@ -244,10 +247,10 @@ describe('services.CommentsService', () => {
|
||||
const userId = users[0].id;
|
||||
|
||||
// first time
|
||||
await CommentsService.addTag(commentId, tagName, userId, 'PUBLIC');
|
||||
await CommentsService.addTag(commentId, tagName, userId);
|
||||
|
||||
// second time should fail
|
||||
await expect(CommentsService.addTag(commentId, tagName, userId, 'PUBLIC')).to.be.rejected;
|
||||
await expect(CommentsService.addTag(commentId, tagName, userId)).to.be.rejected;
|
||||
});
|
||||
});
|
||||
|
||||
@@ -255,7 +258,7 @@ describe('services.CommentsService', () => {
|
||||
it('removes a tag', async () => {
|
||||
const commentId = comments[0].id;
|
||||
const tagName = 'BEST';
|
||||
await CommentsService.addTag(commentId, tagName, users[0].id, 'PUBLIC');
|
||||
await CommentsService.addTag(commentId, tagName, users[0].id);
|
||||
const {tags} = await CommentsService.findById(commentId);
|
||||
expect(tags.length).to.equal(1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user