Skip to content

Commit

Permalink
fix(page-job-scheduler): corrige erro quando 'firstExecution' undefined
Browse files Browse the repository at this point in the history
Corrigo erro quando 'firstExecution' é definido como undefined

fixes DTHFUI-10385
  • Loading branch information
anderson-gregorio-totvs committed Dec 5, 2024
1 parent 1422f16 commit ddc65cb
Showing 1 changed file with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -808,17 +808,12 @@ describe('PoPageJobSchedulerService:', () => {
});

it(`replaceHourFirstExecution: should replace hour add time zone`, () => {
const initialDate = new Date(2025, 11, 24, 23, 59, 0);
const isoDate = initialDate.toISOString();
const stringDate = initialDate.toString();

const timeToReplace = '23:59';
const stringDate = new Date().toString();
const timeZone = `${stringDate.substring(28, 31)}:${stringDate.substring(31, 33)}`;
const result = `2025-12-25T23:59:00${timeZone}`;

poPageJobSchedulerService['replaceHourFirstExecution'](isoDate, timeToReplace);
const result = `2025-12-24T23:59:00${timeZone}`;

expect(poPageJobSchedulerService['replaceHourFirstExecution'](isoDate, timeToReplace)).toBe(result);
expect(poPageJobSchedulerService['replaceHourFirstExecution']('2025-12-24', '23:59')).toBe(result);
});

it('returnValidExecutionParameter: should remove keys that have undefined value', () => {
Expand Down

0 comments on commit ddc65cb

Please sign in to comment.