diff --git a/test/api/v3/integration/challenges/POST-challenges.test.js b/test/api/v3/integration/challenges/POST-challenges.test.js index c21073e77f..92f58c29cc 100644 --- a/test/api/v3/integration/challenges/POST-challenges.test.js +++ b/test/api/v3/integration/challenges/POST-challenges.test.js @@ -314,5 +314,33 @@ describe('POST /challenges', () => { groupLeader = await groupLeader.sync(); expect(groupLeader.achievements.joinedChallenge).to.be.true; }); + + it('sets summary to challenges name when not supplied', async () => { + const name = 'Test Challenge'; + const challenge = await groupLeader.post('/challenges', { + group: group._id, + name, + shortName: 'TC Label', + }); + + const updatedChallenge = await groupLeader.get(`/challenges/${challenge._id}`); + + expect(updatedChallenge.summary).to.eql(name); + }); + + it('sets summary to challenges', async () => { + const name = 'Test Challenge'; + const summary = 'Test Summary Challenge'; + const challenge = await groupLeader.post('/challenges', { + group: group._id, + name, + shortName: 'TC Label', + summary, + }); + + const updatedChallenge = await groupLeader.get(`/challenges/${challenge._id}`); + + expect(updatedChallenge.summary).to.eql(summary); + }); }); }); diff --git a/test/api/v3/integration/groups/POST-groups.test.js b/test/api/v3/integration/groups/POST-groups.test.js index a5471a0166..b310e94627 100644 --- a/test/api/v3/integration/groups/POST-groups.test.js +++ b/test/api/v3/integration/groups/POST-groups.test.js @@ -44,6 +44,32 @@ describe('POST /group', () => { }, }); }); + + it('sets summary to groups name when not supplied', async () => { + const name = 'Test Group'; + const group = await user.post('/groups', { + name, + type: 'guild', + }); + + const updatedGroup = await user.get(`/groups/${group._id}`); + + expect(updatedGroup.summary).to.eql(name); + }); + + it('sets summary to groups', async () => { + const name = 'Test Group'; + const summary = 'Test Summary'; + const group = await user.post('/groups', { + name, + type: 'guild', + summary, + }); + + const updatedGroup = await user.get(`/groups/${group._id}`); + + expect(updatedGroup.summary).to.eql(summary); + }); }); context('Guilds', () => {