fix test lint

This commit is contained in:
Matteo Pagliazzi
2019-10-08 20:45:38 +02:00
parent e37f4467f8
commit 85fb5f33aa
367 changed files with 6635 additions and 6080 deletions

View File

@@ -1,15 +1,16 @@
import { v4 as generateUUID } from 'uuid';
import { each } from 'lodash';
import {
generateUser,
generateGroup,
translate as t,
} from '../../../../../helpers/api-integration/v3';
import { v4 as generateUUID } from 'uuid';
import { each } from 'lodash';
describe('GET /tasks/group/:groupId', () => {
let user, group, task, groupWithTask;
let tasks = [];
let tasksToTest = {
let user; let group; let task; let
groupWithTask;
const tasks = [];
const tasksToTest = {
habit: {
text: 'test habit',
type: 'habit',
@@ -39,7 +40,7 @@ describe('GET /tasks/group/:groupId', () => {
});
it('returns error when group is not found', async () => {
let dummyId = generateUUID();
const dummyId = generateUUID();
await expect(user.get(`/tasks/group/${dummyId}`)).to.eventually.be.rejected.and.eql({
code: 404,
@@ -57,17 +58,17 @@ describe('GET /tasks/group/:groupId', () => {
});
it('gets group tasks', async () => {
let getTask = await user.get(`/tasks/group/${groupWithTask._id}`);
const getTask = await user.get(`/tasks/group/${groupWithTask._id}`);
expect(getTask).to.eql(tasks);
});
it('gets group tasks filtered by type', async () => {
let groupTasks = await user.get(`/tasks/group/${groupWithTask._id}?type=${task.type}s`);
const groupTasks = await user.get(`/tasks/group/${groupWithTask._id}?type=${task.type}s`);
expect(groupTasks).to.eql([task]);
});
it('cannot get a task owned by someone else', async () => {
let anotherUser = await generateUser();
const anotherUser = await generateUser();
await expect(anotherUser.get(`/tasks/group/${groupWithTask._id}`)).to.eventually.be.rejected.and.eql({
code: 404,