Skip to content

Commit

Permalink
Add tz to unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Respirayson committed Jul 19, 2024
1 parent 61df45a commit 1da23bc
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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'));

Check failure on line 126 in src/web/app/components/session-edit-form/session-edit-form.component.spec.ts

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

This line has a length of 138. Maximum allowed is 120

Check failure on line 126 in src/web/app/components/session-edit-form/session-edit-form.component.spec.ts

View workflow job for this annotation

GitHub Actions / lint (windows-latest)

This line has a length of 138. Maximum allowed is 120
component.model.customSessionVisibleTime = dateTimeService.getTimeInstance(moment().tz(component.model.timeZone).subtract(1, 'hours'));

Check failure on line 127 in src/web/app/components/session-edit-form/session-edit-form.component.spec.ts

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

This line has a length of 139. Maximum allowed is 120

Check failure on line 127 in src/web/app/components/session-edit-form/session-edit-form.component.spec.ts

View workflow job for this annotation

GitHub Actions / lint (windows-latest)

This line has a length of 139. Maximum allowed is 120
component.configureSessionVisibleDateTime(date, time);
expect(component.model.customSessionVisibleDate).not.toEqual(date);
expect(component.model.customSessionVisibleTime).not.toEqual(time);
Expand Down

0 comments on commit 1da23bc

Please sign in to comment.