mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
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:
committed by
Matteo Pagliazzi
parent
ec7ded042b
commit
360aaa9f0b
@@ -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;
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user