Add more achievements to notifications list (#11332)

* Add more achievements to notifications list

* use addNotification

* Fix logic to not award stable achievements over and over

* Improve achievement display

* Fix setting notifications for party inviter

* Add tests that notifications are added correctly

* Fix tests
This commit is contained in:
Phillip Thelen
2019-10-18 17:04:33 +02:00
committed by Matteo Pagliazzi
parent ec7ded042b
commit 360aaa9f0b
8 changed files with 108 additions and 25 deletions

View File

@@ -314,6 +314,7 @@ describe('POST /group/:groupId/join', () => {
name: 'Testing Party',
type: 'party',
});
await leader.post(`/groups/${party._id}/invite`, {
uuids: [member._id],
});
@@ -325,7 +326,9 @@ describe('POST /group/:groupId/join', () => {
await leader.sync();
expect(member).to.have.nested.property('achievements.partyUp', true);
expect(member.notifications.find(notification => notification.type === 'ACHIEVEMENT_PARTY_UP')).to.exist;
expect(leader).to.have.nested.property('achievements.partyUp', true);
expect(leader.notifications.find(notification => notification.type === 'ACHIEVEMENT_PARTY_UP')).to.exist;
});
it('does not award Party On achievement to party of size 2', async () => {
@@ -349,7 +352,9 @@ describe('POST /group/:groupId/join', () => {
await leader.sync();
expect(member).to.have.nested.property('achievements.partyOn', true);
expect(member.notifications.find(notification => notification.type === 'ACHIEVEMENT_PARTY_ON')).to.exist;
expect(leader).to.have.nested.property('achievements.partyOn', true);
expect(leader.notifications.find(notification => notification.type === 'ACHIEVEMENT_PARTY_ON')).to.exist;
});
});
});