mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 14:17:22 +01:00
Added summary field tests (#9883)
* Added summary field tests * Fixed typo
This commit is contained in:
@@ -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);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user