mirror of
https://github.com/HabitRPG/habitica.git
synced 2026-04-24 03:25:47 -05:00
Fixed broken tests and style changes
This commit is contained in:
@@ -704,14 +704,14 @@ describe('cron', () => {
|
||||
|
||||
cron({user, tasksByType, daysMissed, analytics});
|
||||
|
||||
expect(user.notifications.length - notifsBefore2).to.equal(1);
|
||||
expect(user.notifications[1].type).to.not.equal('CRON');
|
||||
expect(user.notifications[2].type).to.equal('CRON');
|
||||
expect(user.notifications[2].data).to.eql({
|
||||
expect(user.notifications.length - notifsBefore2).to.equal(0);
|
||||
expect(user.notifications[0].type).to.not.equal('CRON');
|
||||
expect(user.notifications[1].type).to.equal('CRON');
|
||||
expect(user.notifications[1].data).to.eql({
|
||||
hp: user.stats.hp - hpBefore2 - (hpBefore2 - hpBefore1),
|
||||
mp: user.stats.mp - mpBefore2 - (mpBefore2 - mpBefore1),
|
||||
});
|
||||
expect(user.notifications[1].type).to.not.equal('CRON');
|
||||
expect(user.notifications[0].type).to.not.equal('CRON');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -785,9 +785,7 @@ describe('cron', () => {
|
||||
cron({user, tasksByType, daysMissed, analytics});
|
||||
cron({user, tasksByType, daysMissed, analytics});
|
||||
|
||||
let filteredNotifications = filter(user.notifications, function filterNotifications (notification) {
|
||||
return notification.type === 'LOGIN_INCENTIVE';
|
||||
});
|
||||
let filteredNotifications = user.notifications.filter(n => n.type === 'LOGIN_INCENTIVE');
|
||||
|
||||
expect(filteredNotifications.length).to.equal(1);
|
||||
});
|
||||
|
||||
@@ -131,7 +131,7 @@ function trackCronAnalytics (analytics, user, _progress, options) {
|
||||
function awardLoginIncentives (user) {
|
||||
if (user.loginIncentives > 50) return;
|
||||
|
||||
// Remove old noitification if it exists
|
||||
// Remove old notifications if they exists
|
||||
user.notifications
|
||||
.toObject()
|
||||
.find((notif, index) => {
|
||||
|
||||
Reference in New Issue
Block a user