message: add a send-notifications test for notifications that don't expire
diff: @@ -9,7 +9,7 @@ import * as Sentry from '@sentry/node';
  import sentryTestkit from 'sentry-testkit';
  // https://github.com/graphile/worker/blob/e3176eab42ada8f4f3718192bada776c22946583/__tests__/helpers.ts#L135
  -export function makeMockJob(taskIdentifier: string): Job {
  +function makeMockJob(taskIdentifier: string): Job {
  const createdAt = new Date(Date.now() - 12345678);
  return {
  id: String(Math.floor(Math.random() * 4294967296)),
  @@ -39,10 +39,10 @@ let helpers = makeJobHelpers({}, makeMockJob('send-notifications'), {
  const messageID = 'firebase-message-id';
  let createPushNotification: (prefix: string) => PushNotificationData = (prefix = '') => ({
  - notificationId: `${prefix}-mock-notification-id`,
  + notificationId: `${prefix}mock-notification-id`,
  notificationTitle: `${prefix}notification-title`,
  notificationBody: `${prefix}notification-body`,
  - notificationData: [],
  + notificationData: {},
  notificationType: `${prefix}mock`,
  pushClientId: 'push-client-id',
  });
  @@ -50,6 +50,8 @@ let existingNotification = createPushNotification('existing-');
  let newlyAddedNotification = createPushNotification('newly-added-');
  let expiredNotification = createPushNotification('expired-');
  expiredNotification.sendBy = Date.now() - 1;
  +let evergreenNotification = createPushNotification('evergreen-');
  +evergreenNotification.sendBy = undefined;
  let lastSentData: any;
  let notificationSent = false;
  @@ -245,4 +247,18 @@ describe('SendNotificationsTask expired notifications', function () {
  notificationType: expiredNotification.notificationType,
  });
  });
  +
  + it('should not expire a notification without a sendBy', async function () {
  + await subject.perform(evergreenNotification, helpers);
  +
  + expect(lastSentData).to.deep.equal({
  + notification: {
  + body: evergreenNotification.notificationBody,
  + title: evergreenNotification.notificationTitle,
  + },
  + data: evergreenNotification.notificationData,
  + token: evergreenNotification.pushClientId,
  + });
  + expect(notificationSent).to.equal(true);
  + });
  });
  