Challenge Won Notification improvements (#12762)

* challenge won notification: add more info

* update tests

* use new notification on web, fixes #7716

* wip design

* finalize design

* fix markdown rendering
This commit is contained in:
Matteo Pagliazzi
2020-11-10 18:47:13 +01:00
committed by GitHub
parent 4319bd5ad1
commit 181b33101e
19 changed files with 261 additions and 124 deletions

View File

@@ -103,7 +103,15 @@ describe('POST /challenges/:challengeId/winner/:winnerId', () => {
await expect(winningUser.sync()).to.eventually.have.nested.property('achievements.challenges').to.include(challenge.name);
// 2 because winningUser just joined the challenge, which now awards an achievement
expect(winningUser.notifications.length).to.equal(2);
expect(winningUser.notifications[1].type).to.equal('WON_CHALLENGE');
const notif = winningUser.notifications[1];
expect(notif.type).to.equal('WON_CHALLENGE');
expect(notif.data).to.eql({
id: challenge._id,
name: challenge.name,
prize: challenge.prize,
leader: challenge.leader,
});
});
it('gives winner gems as reward', async () => {