From 47f5b9d6371f5f3918b50d7de16b59f916243bf6 Mon Sep 17 00:00:00 2001 From: Rahul Gautam Singh Date: Wed, 25 Dec 2024 10:55:50 +0530 Subject: [PATCH] add test --- .../update/pr/body/config-description.spec.ts | 10 ++++++++++ .../repository/update/pr/body/config-description.ts | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/workers/repository/update/pr/body/config-description.spec.ts b/lib/workers/repository/update/pr/body/config-description.spec.ts index dc446103d06e94..47a8956c8314fd 100644 --- a/lib/workers/repository/update/pr/body/config-description.spec.ts +++ b/lib/workers/repository/update/pr/body/config-description.spec.ts @@ -70,6 +70,16 @@ describe('workers/repository/update/pr/body/config-description', () => { ); }); + it('displays later schedules', () => { + const res = getPrConfigDescription({ + ...config, + schedule: ['before 6am on Monday', 'after 3pm on Tuesday'], + }); + expect(res).toContain( + '"before 6am on Monday,after 3pm on Tuesday" (UTC)', + ); + }); + it('renders undefined schedule', () => { const res = getPrConfigDescription(config); expect(res).toContain(`At any time (no schedule defined).`); diff --git a/lib/workers/repository/update/pr/body/config-description.ts b/lib/workers/repository/update/pr/body/config-description.ts index cc5122ae8230cd..8cea8e4d68df10 100644 --- a/lib/workers/repository/update/pr/body/config-description.ts +++ b/lib/workers/repository/update/pr/body/config-description.ts @@ -84,7 +84,7 @@ function getReadableCronSchedule(scheduleText: string[]): string | null { throwExceptionOnParseError: false, }) .replace('Every minute, ', ''), - ) + ` ( ${String(cron)} )`, + ) + ` ( ${cron} )`, ) .join(', '); } catch {