Skip to content

Commit

Permalink
fix: FORMS-1037 handle missing submission schedule (bcgov#1304)
Browse files Browse the repository at this point in the history
  • Loading branch information
WalterMoar authored Mar 7, 2024
1 parent 9da22b1 commit 5381e73
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/src/forms/email/reminderService.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ const service = {
}),
];
}

return [];
},
_getGraceDate: (schedule) => {
let substartDate = moment(schedule.openSubmissionDateTime);
Expand Down
10 changes: 10 additions & 0 deletions app/tests/unit/forms/email/reminderService.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ const schedule = {
closeSubmissionDateTime: null,
};

describe('_init', () => {
it('should handle reminder enabled with empty schedule', async () => {
reminderService._getForms = jest.fn().mockReturnValue([{ schedule: {} }]);

const result = await reminderService._init();

expect(result.errors).not.toBe([]);
});
});

describe('getDifference', () => {
it('should return the difference between 2 arrays of object', () => {
let obj1 = [
Expand Down

0 comments on commit 5381e73

Please sign in to comment.