From eab8605507d4997f248951b4ac17f0f765a3b94a Mon Sep 17 00:00:00 2001 From: ismay Date: Thu, 1 Feb 2024 16:18:07 +0100 Subject: [PATCH] fix: update label to indicate job is attempting to run now --- src/components/JobTable/NextRun.js | 11 ++++++++--- src/components/JobTable/NextRun.test.js | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/components/JobTable/NextRun.js b/src/components/JobTable/NextRun.js index 40f835677..c99797d12 100644 --- a/src/components/JobTable/NextRun.js +++ b/src/components/JobTable/NextRun.js @@ -28,12 +28,17 @@ const NextRun = ({ nextExecutionTime, enabled }) => { const nextRunIsInPast = nextRun.getTime() <= now /** - * If the time is in the past, that could mean that the task is running, - * and the nextExecutionTime hasn't been updated yet. + * If the nextExecutionTime is in the past that means that + * the scheduled execution time has passed, but the allowed + * startup delay hasn't expired yet. Effectively this means + * that the backend will start the job as soon as possible. + * + * If the window expires before the job can execute the + * nextExecutionTime will be updated to a time in the future. */ if (nextRunIsInPast) { - return i18n.t('Not scheduled') + return i18n.t('Now') } return ( diff --git a/src/components/JobTable/NextRun.test.js b/src/components/JobTable/NextRun.test.js index 1b1f613cd..11bfa19e5 100644 --- a/src/components/JobTable/NextRun.test.js +++ b/src/components/JobTable/NextRun.test.js @@ -47,8 +47,8 @@ describe('', () => { expect(wrapper.find(Tooltip).prop('content')).toEqual(expected) }) - it('returns fallback message for an enabled job and a past execution time', () => { - const expected = 'Not scheduled' + it('returns message for an enabled job and a past execution time', () => { + const expected = 'Now' jest.spyOn(global.Date, 'now').mockImplementation(() => now) const wrapper = shallow(