Webhooks v2 (and other fixes) (#10265)
* begin implementing global webhooks * add checklist item scored webhook * add pet hatched and mount raised webhooks (no tests) * fix typo * add lvl up webhooks, remove corrupt notifications and reorganize pre-save hook * fix typo * add some tests, globalActivity webhook * fix bug in global activiy webhook and add more tests * add tests and fix typo for petHatched and mountRaised webhooks * fix errors and add tests for level up webhook * wip: add default data to all webhooks, change signature for WebhookSender.send (missing tests) * remove unused code * fix unit tests * fix chat webhooks * remove console * fix lint * add and fix webhook tests * add questStarted webhook and questActivity type * add unit tests * add finial tests and features
This commit is contained in:
@@ -117,6 +117,18 @@ describe('common.fns.updateStats', () => {
|
||||
expect(user.addNotification).to.be.calledWith('DROPS_ENABLED');
|
||||
});
|
||||
|
||||
it('add user notification when the user levels up', () => {
|
||||
const initialLvl = user.stats.lvl;
|
||||
updateStats(user, {
|
||||
exp: 3000,
|
||||
});
|
||||
expect(user.addNotification).to.be.calledTwice; // once is for drops enabled
|
||||
expect(user.addNotification).to.be.calledWith('LEVELED_UP', {
|
||||
initialLvl,
|
||||
newLvl: user.stats.lvl,
|
||||
});
|
||||
});
|
||||
|
||||
it('add user notification when rebirth is enabled', () => {
|
||||
user.stats.lvl = 51;
|
||||
updateStats(user, { });
|
||||
|
||||
Reference in New Issue
Block a user