mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 06:37:23 +01:00
Fix 9248: challenge creator should not automatically join their own challenge (#10383)
* fix(challenges): creator should not join challenge automatically * change behavior on the client side as well * update tests and fix membercount * update tests * fix tests
This commit is contained in:
@@ -109,6 +109,7 @@ describe('POST /user/class/cast/:spellId', () => {
|
||||
it('returns an error if a challenge task was targeted', async () => {
|
||||
let {group, groupLeader} = await createAndPopulateGroup();
|
||||
let challenge = await generateChallenge(groupLeader, group);
|
||||
await groupLeader.post(`/challenges/${challenge._id}/join`);
|
||||
await groupLeader.post(`/tasks/challenge/${challenge._id}`, [
|
||||
{type: 'habit', text: 'task text'},
|
||||
]);
|
||||
@@ -238,6 +239,7 @@ describe('POST /user/class/cast/:spellId', () => {
|
||||
it('searing brightness does not affect challenge or group tasks', async () => {
|
||||
let guild = await generateGroup(user);
|
||||
let challenge = await generateChallenge(user, guild);
|
||||
await user.post(`/challenges/${challenge._id}/join`);
|
||||
await user.post(`/tasks/challenge/${challenge._id}`, {
|
||||
text: 'test challenge habit',
|
||||
type: 'habit',
|
||||
|
||||
Reference in New Issue
Block a user