From cffdbadde7a532386bbd10b3c799e373e7357681 Mon Sep 17 00:00:00 2001 From: YG1022 <958065532@qq.com> Date: Tue, 8 Aug 2023 15:38:08 +0800 Subject: [PATCH 1/2] ADM-551:[frontend][fix] justify the time interval automatically generated on the config page --- .../src/components/Metrics/ConfigStep/DateRangePicker/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/components/Metrics/ConfigStep/DateRangePicker/index.tsx b/frontend/src/components/Metrics/ConfigStep/DateRangePicker/index.tsx index a17ed71ccc..cc088f92d4 100644 --- a/frontend/src/components/Metrics/ConfigStep/DateRangePicker/index.tsx +++ b/frontend/src/components/Metrics/ConfigStep/DateRangePicker/index.tsx @@ -32,7 +32,7 @@ export const DateRangePicker = () => { dispatch( updateDateRange({ startDate: value.startOf('date').format('YYYY-MM-DDTHH:mm:ss.SSSZ'), - endDate: value.endOf('date').add(14, 'day').format('YYYY-MM-DDTHH:mm:ss.SSSZ'), + endDate: value.endOf('date').add(13, 'day').format('YYYY-MM-DDTHH:mm:ss.SSSZ'), }) ) } From fd1697770be6f1eaf726eda0aaffa464b90ef016 Mon Sep 17 00:00:00 2001 From: YG1022 <958065532@qq.com> Date: Tue, 8 Aug 2023 17:20:22 +0800 Subject: [PATCH 2/2] ADM-551:[frontend][fix] justify related tests --- .../components/Metrics/ConfigStep/DateRangePicker.test.tsx | 2 +- .../components/Metrics/MetricsStepper/MetricsStepper.test.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/__tests__/src/components/Metrics/ConfigStep/DateRangePicker.test.tsx b/frontend/__tests__/src/components/Metrics/ConfigStep/DateRangePicker.test.tsx index 5014c68784..e5ddcdf2dd 100644 --- a/frontend/__tests__/src/components/Metrics/ConfigStep/DateRangePicker.test.tsx +++ b/frontend/__tests__/src/components/Metrics/ConfigStep/DateRangePicker.test.tsx @@ -53,7 +53,7 @@ describe('DateRangePicker', () => { it('should Auto-fill endDate which is after startDate 14 days when fill right startDate ', () => { const { getByRole } = setup() - const endDate = TODAY.add(14, 'day') + const endDate = TODAY.add(13, 'day') const startDateInput = getByRole('textbox', { name: START_DATE_LABEL }) as HTMLInputElement const endDateInput = getByRole('textbox', { name: END_DATE_LABEL }) as HTMLInputElement diff --git a/frontend/__tests__/src/components/Metrics/MetricsStepper/MetricsStepper.test.tsx b/frontend/__tests__/src/components/Metrics/MetricsStepper/MetricsStepper.test.tsx index 0bbafc9f6e..e7f30ab127 100644 --- a/frontend/__tests__/src/components/Metrics/MetricsStepper/MetricsStepper.test.tsx +++ b/frontend/__tests__/src/components/Metrics/MetricsStepper/MetricsStepper.test.tsx @@ -321,7 +321,7 @@ describe('MetricsStepper', () => { board: { boardId: '', email: '', projectKey: '', site: '', token: '', type: 'Jira' }, calendarType: 'Regular Calendar(Weekend Considered)', dateRange: { - endDate: dayjs().endOf('date').add(14, 'day').format('YYYY-MM-DDTHH:mm:ss.SSSZ'), + endDate: dayjs().endOf('date').add(13, 'day').format('YYYY-MM-DDTHH:mm:ss.SSSZ'), startDate: dayjs().startOf('date').format('YYYY-MM-DDTHH:mm:ss.SSSZ'), }, metrics: ['Velocity', 'Lead time for changes'], @@ -350,7 +350,7 @@ describe('MetricsStepper', () => { board: { boardId: '', email: '', projectKey: '', site: '', token: '', type: 'Jira' }, calendarType: 'Regular Calendar(Weekend Considered)', dateRange: { - endDate: dayjs().endOf('date').add(14, 'day').format('YYYY-MM-DDTHH:mm:ss.SSSZ'), + endDate: dayjs().endOf('date').add(13, 'day').format('YYYY-MM-DDTHH:mm:ss.SSSZ'), startDate: dayjs().startOf('date').format('YYYY-MM-DDTHH:mm:ss.SSSZ'), }, metrics: ['Velocity', 'Lead time for changes'],