mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
fix test lint
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user