diff --git a/test/api/v3/integration/groups/POST-groups_groupId_join.test.js b/test/api/v3/integration/groups/POST-groups_groupId_join.test.js index 92acf9023f..bbad7a8401 100644 --- a/test/api/v3/integration/groups/POST-groups_groupId_join.test.js +++ b/test/api/v3/integration/groups/POST-groups_groupId_join.test.js @@ -258,47 +258,6 @@ describe('POST /group/:groupId/join', () => { await expect(user.get('/user')).to.eventually.have.nested.property('items.quests.basilist', 2); }); - it('deletes previous party where the user was the only member', async () => { - const userToInvite = await generateUser(); - const 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.nested.property('party._id', party._id); - await expect(checkExistence('groups', oldParty._id)).to.eventually.equal(false); - }); - - it('does not allow user to leave a party if a quest was active and they were the only member', async () => { - const userToInvite = await generateUser(); - const oldParty = await userToInvite.post('/groups', { // add user to a party - name: 'Another Test Party', - type: 'party', - }); - - await userToInvite.update({ - [`items.quests.${PET_QUEST}`]: 1, - }); - await userToInvite.post(`/groups/${oldParty._id}/quests/invite/${PET_QUEST}`); - - await expect(checkExistence('groups', oldParty._id)).to.eventually.equal(true); - await user.post(`/groups/${party._id}/invite`, { - uuids: [userToInvite._id], - }); - - await expect(userToInvite.post(`/groups/${party._id}/join`)).to.eventually.be.rejected.and.eql({ - code: 401, - error: 'NotAuthorized', - message: t('messageCannotLeaveWhileQuesting'), - }); - }); - it('invites joining member to active quest', async () => { await user.update({ [`items.quests.${PET_QUEST}`]: 1, diff --git a/test/api/v3/integration/groups/POST-groups_invite.test.js b/test/api/v3/integration/groups/POST-groups_invite.test.js index 02f8c5e20c..58a478be00 100644 --- a/test/api/v3/integration/groups/POST-groups_invite.test.js +++ b/test/api/v3/integration/groups/POST-groups_invite.test.js @@ -1,6 +1,7 @@ import { v4 as generateUUID } from 'uuid'; import nconf from 'nconf'; import { + createAndPopulateGroup, generateUser, generateGroup, translate as t, @@ -581,20 +582,7 @@ describe('Post /groups/:groupId/invite', () => { }); }); - it('allow inviting a user to a party if they are partying solo', async () => { - const userToInvite = await generateUser(); - await userToInvite.post('/groups', { // add user to a party - name: 'Another Test Party', - type: 'party', - }); - - await inviter.post(`/groups/${party._id}/invite`, { - uuids: [userToInvite._id], - }); - expect((await userToInvite.get('/user')).invitations.parties[0].id).to.equal(party._id); - }); - - it('allow inviting a user to 2 different parties', async () => { + it('allows inviting a user to 2 different parties', async () => { // Create another inviter const inviter2 = await generateUser(); @@ -635,29 +623,47 @@ describe('Post /groups/:groupId/invite', () => { }); expect((await userToInvite.get('/user')).invitations.parties[0].id).to.equal(party._id); }); + }); + + describe('party size limits', () => { + let party, partyLeader; + + beforeEach(async () => { + group = await createAndPopulateGroup({ + groupDetails: { + name: 'Test Party', + type: 'party', + privacy: 'private', + }, + // Generate party with 20 members + members: PARTY_LIMIT_MEMBERS - 10, + }); + party = group.group; + partyLeader = group.groupLeader; + }); it('allows 30 members in a party', async () => { const invitesToGenerate = []; - // Generate 29 users to invite (29 + leader = 30 members) - for (let i = 0; i < PARTY_LIMIT_MEMBERS - 1; i += 1) { + // Generate 10 new invites + for (let i = 1; i < 10; i += 1) { invitesToGenerate.push(generateUser()); } const generatedInvites = await Promise.all(invitesToGenerate); // Invite users - expect(await inviter.post(`/groups/${party._id}/invite`, { + expect(await partyLeader.post(`/groups/${party._id}/invite`, { uuids: generatedInvites.map(invite => invite._id), })).to.be.an('array'); }).timeout(10000); - it('does not allow 30+ members in a party', async () => { + it('does not allow >30 members in a party', async () => { const invitesToGenerate = []; - // Generate 30 users to invite (30 + leader = 31 members) - for (let i = 0; i < PARTY_LIMIT_MEMBERS; i += 1) { + // Generate 11 invites + for (let i = 1; i < 11; i += 1) { invitesToGenerate.push(generateUser()); } const generatedInvites = await Promise.all(invitesToGenerate); // Invite users - await expect(inviter.post(`/groups/${party._id}/invite`, { + await expect(partyLeader.post(`/groups/${party._id}/invite`, { uuids: generatedInvites.map(invite => invite._id), })) .to.eventually.be.rejected.and.eql({ diff --git a/website/client/src/assets/scss/icon.scss b/website/client/src/assets/scss/icon.scss index 92930f1124..3ab036333a 100644 --- a/website/client/src/assets/scss/icon.scss +++ b/website/client/src/assets/scss/icon.scss @@ -24,9 +24,9 @@ } } -.icon-16 { - width: 16px; - height: 16px; +.icon-10 { + width: 10px; + height: 10px; } .icon-12 { @@ -34,21 +34,26 @@ height: 12px; } +.icon-16 { + width: 16px; + height: 16px; +} + .icon-24 { width: 24px; height: 24px; } +.icon-32 { + width: 32px; + height: 32px; +} + .icon-48 { width: 48px; height: 48px; } -.icon-10 { - width: 10px; - height: 10px; -} - .inline { display: inline-block; } diff --git a/website/client/src/assets/svg/sync-2.svg b/website/client/src/assets/svg/sync-2.svg new file mode 100644 index 0000000000..61a77879df --- /dev/null +++ b/website/client/src/assets/svg/sync-2.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/website/client/src/components/groups/createPartyModal.vue b/website/client/src/components/groups/createPartyModal.vue index 8b00d4e06c..17c0184331 100644 --- a/website/client/src/components/groups/createPartyModal.vue +++ b/website/client/src/components/groups/createPartyModal.vue @@ -11,9 +11,12 @@
+
+