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,3 +1,4 @@
import { v4 as generateUUID } from 'uuid';
import {
generateUser,
generateHabit,
@@ -5,11 +6,10 @@ import {
generateReward,
} from '../../../../helpers/api-integration/v3';
import common from '../../../../../website/common';
import { v4 as generateUUID } from 'uuid';
describe('GET /user/anonymized', () => {
let user;
let endpoint = '/user/anonymized';
const endpoint = '/user/anonymized';
before(async () => {
user = await generateUser();
@@ -26,7 +26,7 @@ describe('GET /user/anonymized', () => {
},
'items.special.nyeReceived': 'some',
'items.special.valentineReceived': 'some',
webhooks: [{url: 'https://somurl.com'}],
webhooks: [{ url: 'https://somurl.com' }],
'achievements.challenges': 'some',
'inbox.messages': [{ text: 'some text' }],
tags: [{ name: 'some name', challenge: 'some challenge' }],
@@ -35,7 +35,7 @@ describe('GET /user/anonymized', () => {
await generateHabit({ userId: user._id });
await generateHabit({ userId: user._id, text: generateUUID() });
let daily = await generateDaily({ userId: user._id, checklist: [{ completed: false, text: 'this-text' }] });
const daily = await generateDaily({ userId: user._id, checklist: [{ completed: false, text: 'this-text' }] });
expect(daily.checklist[0].text.substr(0, 5)).to.not.eql('item ');
await generateReward({ userId: user._id, text: 'some text 4' });
@@ -63,7 +63,7 @@ describe('GET /user/anonymized', () => {
it('does not return private paths (and apiToken)', async () => {
let returnedUser = await user.get(endpoint);
let tasks2 = returnedUser.tasks;
const tasks2 = returnedUser.tasks;
returnedUser = returnedUser.user;
expect(returnedUser.auth.local).to.not.exist;
expect(returnedUser.apiToken).to.not.exist;
@@ -80,10 +80,10 @@ describe('GET /user/anonymized', () => {
expect(returnedUser.items.special.valentineReceived).to.not.exist;
expect(returnedUser.webhooks).to.not.exist;
expect(returnedUser.achievements.challenges).to.not.exist;
_.forEach(returnedUser.inbox.messages, (msg) => {
_.forEach(returnedUser.inbox.messages, msg => {
expect(msg.text).to.eql('inbox message text');
});
_.forEach(returnedUser.tags, (tag) => {
_.forEach(returnedUser.tags, tag => {
expect(tag.name).to.eql('tag');
expect(tag.challenge).to.eql('challenge');
});
@@ -91,11 +91,11 @@ describe('GET /user/anonymized', () => {
expect(tasks2).to.exist;
expect(tasks2.length).to.eql(5);
expect(tasks2[0].checklist).to.exist;
_.forEach(tasks2, (task) => {
_.forEach(tasks2, task => {
expect(task.text).to.eql('task text');
expect(task.notes).to.eql('task notes');
if (task.checklist) {
_.forEach(task.checklist, (c) => {
_.forEach(task.checklist, c => {
expect(c.text.substr(0, 5)).to.eql('item ');
});
}