mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-07-14 10:12:21 +00:00
lint: Use eslint --fix to automatically fix some issues in api v2 tests
This commit is contained in:
parent
262d04e14c
commit
ff1e5ef221
7 changed files with 20 additions and 20 deletions
|
|
@ -305,7 +305,7 @@ describe('GET /groups/:id', () => {
|
|||
});
|
||||
|
||||
it('returns the user\'s party if an id of "party" is passed in', async () => {
|
||||
let group = await member.get('/groups/party')
|
||||
let group = await member.get('/groups/party');
|
||||
|
||||
expect(group._id).to.eql(createdGroup._id);
|
||||
expect(group.name).to.eql(createdGroup.name);
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ describe('POST /groups', () => {
|
|||
let guild = await leader.post('/groups', {
|
||||
type: 'guild',
|
||||
privacy: 'public',
|
||||
})
|
||||
});
|
||||
|
||||
expect(guild.leader).to.eql(leader._id);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -37,9 +37,9 @@ describe('DELETE /user', () => {
|
|||
});
|
||||
|
||||
it('deletes party when user is the only member', async () => {
|
||||
return expect(user.del('/user').then((result) => {
|
||||
return checkExistence('groups', party._id);
|
||||
})).to.eventually.eql(false);
|
||||
return expect(user.del('/user').then((result) => {
|
||||
return checkExistence('groups', party._id);
|
||||
})).to.eventually.eql(false);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
@ -56,9 +56,9 @@ describe('DELETE /user', () => {
|
|||
});
|
||||
|
||||
it('deletes guild when user is the only member', async () => {
|
||||
return expect(user.del('/user').then((result) => {
|
||||
return checkExistence('groups', guild._id);
|
||||
})).to.eventually.eql(false);
|
||||
return expect(user.del('/user').then((result) => {
|
||||
return checkExistence('groups', guild._id);
|
||||
})).to.eventually.eql(false);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -18,11 +18,11 @@ describe('GET /user', () => {
|
|||
});
|
||||
|
||||
it('does not include password information', async () => {
|
||||
expect(user.auth.local.hashed_password).to.not.exist
|
||||
expect(user.auth.local.salt).to.not.exist
|
||||
expect(user.auth.local.hashed_password).to.not.exist;
|
||||
expect(user.auth.local.salt).to.not.exist;
|
||||
});
|
||||
|
||||
it('does not include api token', async () => {
|
||||
expect(user.apiToken).to.not.exist
|
||||
expect(user.apiToken).to.not.exist;
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -47,9 +47,9 @@ describe('POST /user/batch-update', () => {
|
|||
return expect(user.post('/user/batch-update', [
|
||||
{ op: operation },
|
||||
])).to.eventually.be.rejected.and.eql({
|
||||
code: 500,
|
||||
text: t('messageUserOperationNotFound', { operation }),
|
||||
});
|
||||
code: 500,
|
||||
text: t('messageUserOperationNotFound', { operation }),
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
@ -59,9 +59,9 @@ describe('POST /user/batch-update', () => {
|
|||
return expect(user.post('/user/batch-update', [
|
||||
{op: 'aNotRealOperation'},
|
||||
])).to.eventually.be.rejected.and.eql({
|
||||
code: 500,
|
||||
text: t('messageUserOperationNotFound', { operation: 'aNotRealOperation' }),
|
||||
});
|
||||
code: 500,
|
||||
text: t('messageUserOperationNotFound', { operation: 'aNotRealOperation' }),
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ describe('DELETE /user/tasks/:id', () => {
|
|||
})).to.eventually.be.rejected.and.eql({
|
||||
code: 404,
|
||||
text: t('messageTaskNotFound'),
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('returns an error if the task does not exist', async () => {
|
||||
|
|
@ -26,7 +26,7 @@ describe('DELETE /user/tasks/:id', () => {
|
|||
.to.eventually.be.rejected.and.eql({
|
||||
code: 404,
|
||||
text: t('messageTaskNotFound'),
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('does not delete another user\'s task', async () => {
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ describe('GET /user/tasks/:id', () => {
|
|||
.to.eventually.be.rejected.and.eql({
|
||||
code: 404,
|
||||
text: t('messageTaskNotFound'),
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('does not get another user\'s task', async () => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue