diff --git a/common/locales/en/api-v3.json b/common/locales/en/api-v3.json index c10fd1647a..bc71703017 100644 --- a/common/locales/en/api-v3.json +++ b/common/locales/en/api-v3.json @@ -65,5 +65,6 @@ "uuidsMustBeAnArray": "UUIDs invites must be a an Array.", "emailsMustBeAnArray": "Email invites must be a an Array.", "canOnlyInviteMaxInvites": "You can only invite \"<%= maxInvites %>\" at a time", - "cantOnlyUnlinkChalTask": "Only challenges tasks can be unlinked." + "cantOnlyUnlinkChalTask": "Only challenges tasks can be unlinked.", + "questInviteNotFound": "No quest invitation found." } diff --git a/test/api/v3/integration/groups/POST-groups_groupId_quests_accept.test.js b/test/api/v3/integration/groups/POST-groups_groupId_quests_accept.test.js new file mode 100644 index 0000000000..44286e6e79 --- /dev/null +++ b/test/api/v3/integration/groups/POST-groups_groupId_quests_accept.test.js @@ -0,0 +1,51 @@ +import { + createAndPopulateGroup, + generateUser, + translate as t, +} from '../../../../helpers/api-v3-integration.helper'; + +describe.skip('POST /groups/:groupId/quests/accept', () => { + let questingGroup; + let leader; + let member; + + beforeEach(async () => { + let { group, groupLeader, members } = await createAndPopulateGroup({ + { type: 'party', privacy: 'private' }, + members: 1, + }); + + questingGroup = group; + leader = groupLeader; + member = members[0]; + }); + + context('failure conditions', () => { + it('does not accept quest without an invite', async () => { + await expect(member.post(`/groups/${questingGroup._id}/quests/accept`, {})) + .to.eventually.be.rejected.and.eql({ + code: 404, + error: 'NotFound', + message: t('questInviteNotFound'), + }); + + )}; + + it('does not accept quest for a group in which user is not a member', () => { + + )}; + )}; + context('successfully accepting a quest invitation', () => { + it('joins a quest from an invitation', () => { + + )}; + + it('does not begin the quest if pending invitations remain', () => { + + )}; + + it('begins the quest if accepting the last pending invite', () => { + + )}; + )}; +)};