Skip to content

Commit

Permalink
PSP-9655 : FT-REG: When creating a new file approximately after 4pm P…
Browse files Browse the repository at this point in the history
…ST timezone, PIMS timestamps the file with the next day's date
  • Loading branch information
Herrera committed Dec 18, 2024
1 parent 56b6c5e commit d13d7c2
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ describe('AcquisitionSummaryView component', () => {
});

it('renders acquisition-related dates', async () => {
const { getByText } = setup(
const { getByText, getByTestId } = setup(
{
acquisitionFile: {
...mockAcquisitionFileResponse(),
Expand All @@ -136,6 +136,7 @@ describe('AcquisitionSummaryView component', () => {
await waitForEffects();
expect(getByText('Jan 10, 2030')).toBeVisible();
expect(getByText('Mar 10, 2035')).toBeVisible();
expect(getByTestId('assigned-date')).toHaveTextContent('Dec 17, 2024');
});

it('renders owner solicitor information with primary contact', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { InterestHolderType } from '@/constants/interestHolderTypes';
import { usePersonRepository } from '@/features/contacts/repositories/usePersonRepository';
import useKeycloakWrapper from '@/hooks/useKeycloakWrapper';
import { ApiGen_Concepts_AcquisitionFile } from '@/models/api/generated/ApiGen_Concepts_AcquisitionFile';
import { exists, prettyFormatDate } from '@/utils';
import { exists, prettyFormatDate, prettyFormatUTCDate } from '@/utils';
import { formatApiPersonNames } from '@/utils/personUtils';

import { cannotEditMessage } from '../../../common/constants';
Expand Down Expand Up @@ -93,7 +93,9 @@ const AcquisitionSummaryView: React.FC<IAcquisitionSummaryViewProps> = ({
)}
</Section>
<Section header="Schedule">
<SectionField label="Assigned date">{prettyFormatDate(detail.assignedDate)}</SectionField>
<SectionField label="Assigned date" valueTestId="assigned-date">
{prettyFormatUTCDate(detail.assignedDate)}
</SectionField>
<SectionField
label="Delivery date"
tooltip="Date for delivery of the property to the project"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,9 @@ exports[`AcquisitionSummaryView component > matches snapshot 1`] = `
</div>
<div
class="c5 text-left col"
data-testid="assigned-date"
>
Jun 27, 2022
Dec 17, 2024
</div>
</div>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { ApiGen_Concepts_AcquisitionFile } from '@/models/api/generated/ApiGen_C
import { ApiGen_Concepts_AcquisitionFileOwner } from '@/models/api/generated/ApiGen_Concepts_AcquisitionFileOwner';
import { ApiGen_Concepts_InterestHolder } from '@/models/api/generated/ApiGen_Concepts_InterestHolder';
import { getEmptyBaseAudit } from '@/models/defaultInitializers';
import { formatUTCDateTime } from '@/utils';
import { fromTypeCode, toTypeCodeNullable } from '@/utils/formUtils';
import { exists, isValidId, isValidIsoDateTime } from '@/utils/utils';

Expand Down Expand Up @@ -120,7 +121,7 @@ export class UpdateAcquisitionSummaryFormModel
newForm.legacyFileNumber = model.legacyFileNumber ?? undefined;
newForm.fileName = model.fileName || '';
newForm.rowVersion = model.rowVersion ?? undefined;
newForm.assignedDate = model.assignedDate ?? undefined;
newForm.assignedDate = model.assignedDate ? formatUTCDateTime(model.assignedDate) : '';
newForm.deliveryDate = model.deliveryDate ?? undefined;
newForm.estimatedCompletionDate = model.estimatedCompletionDate ?? undefined;
newForm.possessionDate = model.possessionDate ?? undefined;
Expand Down
2 changes: 1 addition & 1 deletion source/frontend/src/mocks/acquisitionFiles.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export const mockAcquisitionFileResponse = (
},
productId: null,
legacyFileNumber: 'legacy file number',
assignedDate: '2022-06-27T00:00:00',
assignedDate: '2024-12-18T02:04:53.18',
deliveryDate: '2022-07-29T00:00:00',
estimatedCompletionDate: '2024-07-10T00:00:00',
possessionDate: '2025-07-10T00:00:00',
Expand Down

0 comments on commit d13d7c2

Please sign in to comment.