New feature that notifies a user when their group invite is accepted. (#8244)

* New notification feature that notifies a user when their group invite is accepted. fixes #7788

* Updating to a modal instead of a popup notification

* Making a generic modal template and using it for notifications of group invitation acceptance.

* Working with paglias's comments for doing translation server side.

* Final changes based on pr comments.
This commit is contained in:
Travis
2016-12-01 10:04:57 -08:00
committed by Matteo Pagliazzi
parent c42f81b629
commit 6a63f080ad
7 changed files with 76 additions and 2 deletions

View File

@@ -134,6 +134,22 @@ describe('POST /group/:groupId/join', () => {
await expect(user.get('/user')).to.eventually.have.deep.property('items.quests.basilist', 1);
});
it('notifies inviting user that their invitation was accepted', async () => {
await invitedUser.post(`/groups/${guild._id}/join`);
let inviter = await user.get('/user');
let expectedData = {
headerText: t('invitationAcceptedHeader'),
bodyText: t('invitationAcceptedBody', {
username: invitedUser.auth.local.username,
groupName: guild.name,
}),
};
expect(inviter.notifications[0].type).to.eql('GROUP_INVITE_ACCEPTED');
expect(inviter.notifications[0].data).to.eql(expectedData);
});
});
});
@@ -172,6 +188,23 @@ describe('POST /group/:groupId/join', () => {
await expect(invitedUser.get('/user')).to.eventually.have.deep.property('party._id', party._id);
});
it('notifies inviting user that their invitation was accepted', async () => {
await invitedUser.post(`/groups/${party._id}/join`);
let inviter = await user.get('/user');
let expectedData = {
headerText: t('invitationAcceptedHeader'),
bodyText: t('invitationAcceptedBody', {
username: invitedUser.auth.local.username,
groupName: party.name,
}),
};
expect(inviter.notifications[0].type).to.eql('GROUP_INVITE_ACCEPTED');
expect(inviter.notifications[0].data).to.eql(expectedData);
});
it('clears invitation from user when joining party', async () => {
await invitedUser.post(`/groups/${party._id}/join`);