From 1cd1d454107e9fa689726600e5560c0c7fe0d7fc Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Wed, 4 Dec 2019 18:20:19 +0000 Subject: [PATCH] fix(test): independent notif check --- test/api/unit/libs/cron.test.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/api/unit/libs/cron.test.js b/test/api/unit/libs/cron.test.js index e923cb0f9c..eb97c47c42 100644 --- a/test/api/unit/libs/cron.test.js +++ b/test/api/unit/libs/cron.test.js @@ -95,8 +95,8 @@ describe('cron', () => { user, tasksByType, daysMissed, analytics, }); expect(user.purchased.plan.mysteryItems.length).to.eql(2); - expect(user.notifications.length).to.eql(3); - expect(user.notifications[0].type).to.eql('NEW_MYSTERY_ITEMS'); + const filteredNotifications = user.notifications.filter(n => n.type === 'NEW_MYSTERY_ITEMS'); + expect(filteredNotifications.length).to.equal(1); }); it('awards multiple mystery item sets if user skipped months between logins', () => { @@ -106,8 +106,8 @@ describe('cron', () => { user, tasksByType, daysMissed, analytics, }); expect(user.purchased.plan.mysteryItems.length).to.eql(4); - expect(user.notifications.length).to.eql(3); - expect(user.notifications[0].type).to.eql('NEW_MYSTERY_ITEMS'); + const filteredNotifications = user.notifications.filter(n => n.type === 'NEW_MYSTERY_ITEMS'); + expect(filteredNotifications.length).to.equal(1); }); it('resets plan.gemsBought on a new month', () => {