From 1da23bccbf4d7f8b9315091cb2e93c5726bbc9f2 Mon Sep 17 00:00:00 2001 From: Respirayson Date: Sat, 20 Jul 2024 02:43:17 +0800 Subject: [PATCH] Add tz to unit test --- .../session-edit-form/session-edit-form.component.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/web/app/components/session-edit-form/session-edit-form.component.spec.ts b/src/web/app/components/session-edit-form/session-edit-form.component.spec.ts index 4be00441ab6..ca419fd3a6c 100644 --- a/src/web/app/components/session-edit-form/session-edit-form.component.spec.ts +++ b/src/web/app/components/session-edit-form/session-edit-form.component.spec.ts @@ -123,8 +123,8 @@ describe('SessionEditFormComponent', () => { it('should not adjust the session visibility date and time if submission opening date and time are later', () => { const date: DateFormat = component.minDateForSubmissionStart; const time: TimeFormat = component.minTimeForSubmissionStart; - component.model.customSessionVisibleDate = dateTimeService.getDateInstance(moment().subtract(1, 'days')); - component.model.customSessionVisibleTime = dateTimeService.getTimeInstance(moment().subtract(1, 'hours')); + component.model.customSessionVisibleDate = dateTimeService.getDateInstance(moment().tz(component.model.timeZone).subtract(1, 'days')); + component.model.customSessionVisibleTime = dateTimeService.getTimeInstance(moment().tz(component.model.timeZone).subtract(1, 'hours')); component.configureSessionVisibleDateTime(date, time); expect(component.model.customSessionVisibleDate).not.toEqual(date); expect(component.model.customSessionVisibleTime).not.toEqual(time);