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

@@ -5,15 +5,15 @@ import {
describe('POST /user/push-devices', () => {
let user;
let regId = '10';
let type = 'ios';
const regId = '10';
const type = 'ios';
beforeEach(async () => {
user = await generateUser();
});
it('returns an error when regId is not provided', async () => {
await expect(user.post('/user/push-devices'), {type})
await expect(user.post('/user/push-devices'), { type })
.to.eventually.be.rejected.and.to.eql({
code: 400,
error: 'BadRequest',
@@ -22,7 +22,7 @@ describe('POST /user/push-devices', () => {
});
it('returns an error when type is not provided', async () => {
await expect(user.post('/user/push-devices', {regId}))
await expect(user.post('/user/push-devices', { regId }))
.to.eventually.be.rejected.and.to.eql({
code: 400,
error: 'BadRequest',
@@ -31,7 +31,7 @@ describe('POST /user/push-devices', () => {
});
it('returns an error when type is not valid', async () => {
await expect(user.post('/user/push-devices', {regId, type: 'invalid'}))
await expect(user.post('/user/push-devices', { regId, type: 'invalid' }))
.to.eventually.be.rejected.and.to.eql({
code: 400,
error: 'BadRequest',
@@ -40,8 +40,8 @@ describe('POST /user/push-devices', () => {
});
it('fails silently if user already has the push device', async () => {
await user.post('/user/push-devices', {type, regId});
const response = await user.post('/user/push-devices', {type, regId});
await user.post('/user/push-devices', { type, regId });
const response = await user.post('/user/push-devices', { type, regId });
await user.sync();
expect(response.message).to.equal(t('pushDeviceAdded'));
@@ -52,7 +52,7 @@ describe('POST /user/push-devices', () => {
});
it('adds a push device to the user', async () => {
const response = await user.post('/user/push-devices', {type, regId});
const response = await user.post('/user/push-devices', { type, regId });
await user.sync();
expect(response.message).to.equal(t('pushDeviceAdded'));
@@ -63,7 +63,7 @@ describe('POST /user/push-devices', () => {
});
it('removes a push device to the user', async () => {
await user.post('/user/push-devices', {type, regId});
await user.post('/user/push-devices', { type, regId });
const response = await user.del(`/user/push-devices/${regId}`);
await user.sync();