lint: Correct linting errors in api v3 tests

This commit is contained in:
Blade Barringer
2015-12-31 08:50:02 -06:00
parent 70151fd073
commit 9428c6d997
25 changed files with 218 additions and 234 deletions
@@ -36,7 +36,7 @@ describe('GET /groups/:groupId/chat', () => {
});
it('returns Guild chat', () => {
return user.get('/groups/' + group._id + '/chat')
return user.get(`/groups/${group._id}/chat`)
.then((getChat) => {
expect(getChat).to.eql(group.chat);
});
@@ -67,7 +67,7 @@ describe('GET /groups/:groupId/chat', () => {
it('returns error if user is not member of requested private group', () => {
return expect(
user.get('/groups/' + group._id + '/chat')
user.get(`/groups/${group._id}/chat`)
)
.to.eventually.be.rejected.and.eql({
code: 404,
@@ -2,7 +2,7 @@ import {
generateUser,
translate as t,
} from '../../../../helpers/api-integration.helper';
import _ from 'lodash';
import { find } from 'lodash';
describe('POST /chat/:chatId/flag', () => {
let user;
@@ -66,7 +66,7 @@ describe('POST /chat/:chatId/flag', () => {
return user.get(`/groups/${group._id}`);
})
.then((updatedGroup) => {
let messageToCheck = _.find(updatedGroup.chat, {id: message.id});
let messageToCheck = find(updatedGroup.chat, {id: message.id});
expect(messageToCheck.flags[user._id]).to.equal(true);
});
});
@@ -89,7 +89,7 @@ describe('POST /chat/:chatId/flag', () => {
return user.get(`/groups/${group._id}`);
})
.then((updatedGroup) => {
let messageToCheck = _.find(updatedGroup.chat, {id: message.id});
let messageToCheck = find(updatedGroup.chat, {id: message.id});
expect(messageToCheck.flags[secondUser._id]).to.equal(true);
expect(messageToCheck.flagCount).to.equal(5);
});
@@ -2,7 +2,7 @@ import {
generateUser,
translate as t,
} from '../../../../helpers/api-integration.helper';
import _ from 'lodash';
import { find } from 'lodash';
describe('POST /chat/:chatId/like', () => {
let user;
@@ -65,7 +65,7 @@ describe('POST /chat/:chatId/like', () => {
return user.get(`/groups/${group._id}`);
})
.then((updatedGroup) => {
let messageToCheck = _.find(updatedGroup.chat, {id: message.id});
let messageToCheck = find(updatedGroup.chat, {id: message.id});
expect(messageToCheck.likes[user._id]).to.equal(true);
});
});
@@ -89,7 +89,7 @@ describe('POST /chat/:chatId/like', () => {
return user.get(`/groups/${group._id}`);
})
.then((updatedGroup) => {
let messageToCheck = _.find(updatedGroup.chat, {id: message.id});
let messageToCheck = find(updatedGroup.chat, {id: message.id});
expect(messageToCheck.likes[user._id]).to.equal(false);
});
});