mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
lint: Fix linting errors in api v2 tests
This commit is contained in:
@@ -5,7 +5,6 @@ import {
|
||||
} from '../../../helpers/api-integration.helper';
|
||||
|
||||
describe('POST /groups/:id', () => {
|
||||
|
||||
context('user is not the leader of the group', () => {
|
||||
let user, otherUser, groupUserDoesNotOwn;
|
||||
|
||||
@@ -30,7 +29,7 @@ describe('POST /groups/:id', () => {
|
||||
|
||||
it('does not allow user to update group', async () => {
|
||||
return expect(user.post(`/groups/${groupUserDoesNotOwn._id}`, {
|
||||
name: 'Change'
|
||||
name: 'Change',
|
||||
})).to.eventually.be.rejected.and.eql({
|
||||
code: 401,
|
||||
text: t('messageGroupOnlyLeaderCanUpdate'),
|
||||
@@ -42,31 +41,27 @@ describe('POST /groups/:id', () => {
|
||||
let user, usersGroup;
|
||||
|
||||
beforeEach(async () => {
|
||||
return generateUser({
|
||||
user = await generateUser({
|
||||
balance: 10,
|
||||
}).then((_user) => {
|
||||
user = _user;
|
||||
});
|
||||
|
||||
return generateGroup(user, {
|
||||
name: 'Original Group Title',
|
||||
type: 'guild',
|
||||
privacy: 'public',
|
||||
});
|
||||
}).then((group) => {
|
||||
usersGroup = group;
|
||||
usersGroup = await generateGroup(user, {
|
||||
name: 'Original Group Title',
|
||||
type: 'guild',
|
||||
privacy: 'public',
|
||||
});
|
||||
});
|
||||
|
||||
it('allows user to update group', async () => {
|
||||
return user.post(`/groups/${usersGroup._id}`, {
|
||||
await user.post(`/groups/${usersGroup._id}`, {
|
||||
name: 'New Group Title',
|
||||
description: 'New group description',
|
||||
}).then((group) => {
|
||||
return user.get(`/groups/${usersGroup._id}`);
|
||||
}).then((group) => {
|
||||
expect(group.name).to.eql('New Group Title');
|
||||
expect(group.description).to.eql('New group description');
|
||||
});
|
||||
|
||||
let group = await user.get(`/groups/${usersGroup._id}`);
|
||||
|
||||
expect(group.name).to.eql('New Group Title');
|
||||
expect(group.description).to.eql('New group description');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user