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,9 +1,9 @@
import { times } from 'lodash';
import {
generateUser,
translate as t,
resetHabiticaDB,
} from '../../../../helpers/api-integration/v3';
import { times } from 'lodash';
describe('GET /hall/patrons', () => {
let user;
@@ -22,14 +22,14 @@ describe('GET /hall/patrons', () => {
});
it('returns all patrons sorted by -backer.tier and with correct fields', async () => {
let patron1 = await generateUser({
backer: {tier: 1},
const patron1 = await generateUser({
backer: { tier: 1 },
});
let patron2 = await generateUser({
backer: {tier: 3},
const patron2 = await generateUser({
backer: { tier: 3 },
});
let patrons = await user.get('/hall/patrons');
const patrons = await user.get('/hall/patrons');
expect(patrons.length).to.equal(2);
expect(patrons[0]._id).to.equal(patron2._id);
expect(patrons[1]._id).to.equal(patron1._id);
@@ -45,14 +45,12 @@ describe('GET /hall/patrons', () => {
});
it('returns only first 50 patrons per request, more if req.query.page is passed', async () => {
await Promise.all(times(53, n => {
return generateUser({backer: {tier: n}});
}));
await Promise.all(times(53, n => generateUser({ backer: { tier: n } })));
let patrons = await user.get('/hall/patrons');
const patrons = await user.get('/hall/patrons');
expect(patrons.length).to.equal(50);
let morePatrons = await user.get('/hall/patrons?page=1');
const morePatrons = await user.get('/hall/patrons?page=1');
expect(morePatrons.length).to.equal(2);
expect(morePatrons[0].backer.tier).to.equal(2);
expect(morePatrons[1].backer.tier).to.equal(1);