mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
lint: Use eslint --fix to automatically fix some issues in api v2 tests
This commit is contained in:
@@ -305,7 +305,7 @@ describe('GET /groups/:id', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('returns the user\'s party if an id of "party" is passed in', async () => {
|
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._id).to.eql(createdGroup._id);
|
||||||
expect(group.name).to.eql(createdGroup.name);
|
expect(group.name).to.eql(createdGroup.name);
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ describe('POST /groups', () => {
|
|||||||
let guild = await leader.post('/groups', {
|
let guild = await leader.post('/groups', {
|
||||||
type: 'guild',
|
type: 'guild',
|
||||||
privacy: 'public',
|
privacy: 'public',
|
||||||
})
|
});
|
||||||
|
|
||||||
expect(guild.leader).to.eql(leader._id);
|
expect(guild.leader).to.eql(leader._id);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -37,9 +37,9 @@ describe('DELETE /user', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('deletes party when user is the only member', async () => {
|
it('deletes party when user is the only member', async () => {
|
||||||
return expect(user.del('/user').then((result) => {
|
return expect(user.del('/user').then((result) => {
|
||||||
return checkExistence('groups', party._id);
|
return checkExistence('groups', party._id);
|
||||||
})).to.eventually.eql(false);
|
})).to.eventually.eql(false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -56,9 +56,9 @@ describe('DELETE /user', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('deletes guild when user is the only member', async () => {
|
it('deletes guild when user is the only member', async () => {
|
||||||
return expect(user.del('/user').then((result) => {
|
return expect(user.del('/user').then((result) => {
|
||||||
return checkExistence('groups', guild._id);
|
return checkExistence('groups', guild._id);
|
||||||
})).to.eventually.eql(false);
|
})).to.eventually.eql(false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -18,11 +18,11 @@ describe('GET /user', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('does not include password information', async () => {
|
it('does not include password information', async () => {
|
||||||
expect(user.auth.local.hashed_password).to.not.exist
|
expect(user.auth.local.hashed_password).to.not.exist;
|
||||||
expect(user.auth.local.salt).to.not.exist
|
expect(user.auth.local.salt).to.not.exist;
|
||||||
});
|
});
|
||||||
|
|
||||||
it('does not include api token', async () => {
|
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', [
|
return expect(user.post('/user/batch-update', [
|
||||||
{ op: operation },
|
{ op: operation },
|
||||||
])).to.eventually.be.rejected.and.eql({
|
])).to.eventually.be.rejected.and.eql({
|
||||||
code: 500,
|
code: 500,
|
||||||
text: t('messageUserOperationNotFound', { operation }),
|
text: t('messageUserOperationNotFound', { operation }),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -59,9 +59,9 @@ describe('POST /user/batch-update', () => {
|
|||||||
return expect(user.post('/user/batch-update', [
|
return expect(user.post('/user/batch-update', [
|
||||||
{op: 'aNotRealOperation'},
|
{op: 'aNotRealOperation'},
|
||||||
])).to.eventually.be.rejected.and.eql({
|
])).to.eventually.be.rejected.and.eql({
|
||||||
code: 500,
|
code: 500,
|
||||||
text: t('messageUserOperationNotFound', { operation: 'aNotRealOperation' }),
|
text: t('messageUserOperationNotFound', { operation: 'aNotRealOperation' }),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ describe('DELETE /user/tasks/:id', () => {
|
|||||||
})).to.eventually.be.rejected.and.eql({
|
})).to.eventually.be.rejected.and.eql({
|
||||||
code: 404,
|
code: 404,
|
||||||
text: t('messageTaskNotFound'),
|
text: t('messageTaskNotFound'),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns an error if the task does not exist', async () => {
|
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({
|
.to.eventually.be.rejected.and.eql({
|
||||||
code: 404,
|
code: 404,
|
||||||
text: t('messageTaskNotFound'),
|
text: t('messageTaskNotFound'),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('does not delete another user\'s task', async () => {
|
it('does not delete another user\'s task', async () => {
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ describe('GET /user/tasks/:id', () => {
|
|||||||
.to.eventually.be.rejected.and.eql({
|
.to.eventually.be.rejected.and.eql({
|
||||||
code: 404,
|
code: 404,
|
||||||
text: t('messageTaskNotFound'),
|
text: t('messageTaskNotFound'),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('does not get another user\'s task', async () => {
|
it('does not get another user\'s task', async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user