add feature to invite user if he is partying solo

This commit is contained in:
Matteo Pagliazzi
2016-01-25 18:17:09 +01:00
parent 211a7bb46a
commit b28e0629b1
4 changed files with 53 additions and 9 deletions

View File

@@ -1,6 +1,7 @@
import {
generateUser,
createAndPopulateGroup,
checkExistence,
translate as t,
} from '../../../../helpers/api-v3-integration.helper';
import { v4 as generateUUID } from 'uuid';
@@ -185,6 +186,23 @@ describe('POST /group/:groupId/join', () => {
await expect(user.get('/user')).to.eventually.have.deep.property('items.quests.basilist', 2);
});
it('deletes previous party where the user was the only member', async () => {
let userToInvite = await generateUser();
let oldParty = await userToInvite.post('/groups', { // add user to a party
name: 'Another Test Party',
type: 'party',
});
await expect(checkExistence('groups', oldParty._id)).to.eventually.equal(true);
await user.post(`/groups/${party._id}/invite`, {
uuids: [userToInvite._id],
});
await userToInvite.post(`/groups/${party._id}/join`);
await expect(user.get('/user')).to.eventually.have.deep.property('party._id', party._id);
await expect(checkExistence('groups', oldParty._id)).to.eventually.equal(false);
});
xit('invites joining member to active quest', async () => {
// TODO start quest