From 3c1263ada688f01d613a017a625922f14df57796 Mon Sep 17 00:00:00 2001 From: Art Lowel Date: Fri, 23 Jul 2021 16:30:25 +0200 Subject: [PATCH] fix timezone issue with test dates --- .../form/resource-policy-form.component.spec.ts | 6 +++--- .../upload/file/section-upload-file.component.spec.ts | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/app/shared/resource-policies/form/resource-policy-form.component.spec.ts b/src/app/shared/resource-policies/form/resource-policy-form.component.spec.ts index 3e7b39d33b..79f842d33b 100644 --- a/src/app/shared/resource-policies/form/resource-policy-form.component.spec.ts +++ b/src/app/shared/resource-policies/form/resource-policy-form.component.spec.ts @@ -25,7 +25,7 @@ import { getMockFormService } from '../../mocks/form-service.mock'; import { FormBuilderService } from '../../form/builder/form-builder.service'; import { EpersonGroupListComponent } from './eperson-group-list/eperson-group-list.component'; import { FormComponent } from '../../form/form.component'; -import { stringToNgbDateStruct } from '../../date.util'; +import { stringToNgbDateStruct, dateToISOFormat } from '../../date.util'; import { ResourcePolicy } from '../../../core/resource-policy/models/resource-policy.model'; import { RESOURCE_POLICY } from '../../../core/resource-policy/models/resource-policy.resource-type'; import { EPersonMock } from '../../testing/eperson.mock'; @@ -107,8 +107,8 @@ export const submittedResourcePolicy = Object.assign(new ResourcePolicy(), { description: 'description', policyType: PolicyType.TYPE_WORKFLOW, action: ActionType.WRITE, - startDate: '2019-04-14T00:00:00Z', - endDate: '2020-04-14T00:00:00Z', + startDate: dateToISOFormat('2019-04-14T00:00:00Z'), + endDate: dateToISOFormat('2020-04-14T00:00:00Z'), type: RESOURCE_POLICY }); diff --git a/src/app/submission/sections/upload/file/section-upload-file.component.spec.ts b/src/app/submission/sections/upload/file/section-upload-file.component.spec.ts index a1e35c33f4..39aebf7413 100644 --- a/src/app/submission/sections/upload/file/section-upload-file.component.spec.ts +++ b/src/app/submission/sections/upload/file/section-upload-file.component.spec.ts @@ -35,6 +35,7 @@ import { getMockSectionUploadService } from '../../../../shared/mocks/section-up import { FormFieldMetadataValueObject } from '../../../../shared/form/builder/models/form-field-metadata-value.model'; import { SubmissionSectionUploadFileEditComponent } from './edit/section-upload-file-edit.component'; import { FormBuilderService } from '../../../../shared/form/builder/form-builder.service'; +import { dateToISOFormat } from '../../../../shared/date.util'; describe('SubmissionSectionUploadFileComponent test suite', () => { @@ -232,8 +233,8 @@ describe('SubmissionSectionUploadFileComponent test suite', () => { const accessConditionsToSave = [ { name: 'openaccess' }, - { name: 'lease', endDate: '2019-01-16T00:00:00Z' }, - { name: 'embargo', startDate: '2019-01-16T00:00:00Z' }, + { name: 'lease', endDate: dateToISOFormat('2019-01-16T00:00:00Z') }, + { name: 'embargo', startDate: dateToISOFormat('2019-01-16T00:00:00Z') }, ]; comp.saveBitstreamData(event); tick();