Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PSP-6659 When creating a file or project after certain time, the created stamp date is a day after #3391

Merged
merged 14 commits into from
Aug 8, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ exports[`Document Results Table matches snapshot 1`] = `
<div
class="col"
>
Jan 1, 0001
Dec 31, 0000
</div>
<div
class="col-auto"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ exports[`Document List View renders as expected 1`] = `
<div
class="col"
>
Jan 1, 0001
Dec 31, 0000
</div>
<div
class="col-auto"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ exports[`DepositsReceivedContainer component renders as expected 1`] = `
style="box-sizing: border-box; flex: 50 0 auto; min-width: 30px; width: 50px; justify-content: right; text-align: right; flex-wrap: wrap; align-items: center; display: flex;"
title=""
>
Sep 15, 2021
Sep 14, 2021
</div>
<div
class="td"
Expand Down Expand Up @@ -397,7 +397,7 @@ Integer nec odio.
style="box-sizing: border-box; flex: 50 0 auto; min-width: 30px; width: 50px; justify-content: right; text-align: right; flex-wrap: wrap; align-items: center; display: flex;"
title=""
>
Mar 1, 2019
Feb 28, 2019
</div>
<div
class="td"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ exports[`DepositsReturnedContainer component renders as expected 1`] = `
style="box-sizing: border-box; flex: 50 0 auto; min-width: 30px; width: 50px; justify-content: right; text-align: right; flex-wrap: wrap; align-items: center; display: flex;"
title=""
>
Feb 1, 2022
Jan 31, 2022
</div>
<div
class="td"
Expand Down Expand Up @@ -241,7 +241,7 @@ exports[`DepositsReturnedContainer component renders as expected 1`] = `
style="box-sizing: border-box; flex: 50 0 auto; min-width: 30px; width: 50px; justify-content: right; text-align: right; flex-wrap: wrap; align-items: center; display: flex;"
title=""
>
Feb 16, 2022
Feb 15, 2022
</div>
<div
class="td"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ describe('DetailTermInformation component', () => {

it('renders the start date in the expected format', () => {
const { getByText } = setup({
lease: { ...new LeaseFormModel(), startDate: '2000-01-01' },
lease: { ...new LeaseFormModel(), startDate: '2000-01-01T18:00' },
});
expect(getByText('Jan 1, 2000')).toBeVisible();
});

it('renders the end date in the expected format', () => {
const { getByText } = setup({
lease: { ...new LeaseFormModel(), startDate: '2001-01-01' },
lease: { ...new LeaseFormModel(), startDate: '2001-01-01T18:00' },
});
expect(getByText('Jan 1, 2001')).toBeVisible();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,18 @@ describe('DetailTermInformation component', () => {
...defaultFormLeaseTerm,
id: 1,
leaseId: 1,
startDate: '2020-01-01',
expiryDate: '2022-01-01',
renewalDate: '2021-01-01',
startDate: '2020-01-01T18:00',
expiryDate: '2022-01-01T18:00',
renewalDate: '2021-01-01T18:00',
statusTypeCode: { id: 'EX', description: 'exercised', isDisabled: false },
},
],
},
});
expect(getByText('initial term')).toBeVisible();
expect(getByText('Jan 1, 2020')).toBeVisible();
expect(getByText('Jan 1, 2020')).toBeVisible();
expect(getByText('Jan 1, 2021')).toBeVisible();
expect(getByText('Jan 1, 2022')).toBeVisible();
expect(getByText('exercised')).toBeVisible();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ exports[`Lease Insurance renders as expected 1`] = `
<div
class="c4 text-left col"
>
Jan 1, 2022
Dec 31, 2021
</div>
</div>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ const defaultTestFormLeaseTerm = {
...defaultFormLeaseTerm,
id: 1,
isTermExercised: false,
startDate: '2020-01-01',
expiryDate: '2020-12-15',
startDate: '2020-01-01T18:00',
expiryDate: '2020-12-15T18:00',
paymentAmount: 1000,
};

Expand Down Expand Up @@ -280,8 +280,8 @@ describe('TermsForm component', () => {
...defaultTestFormLeaseTerm,
isTermExercised: true,
payments: [
{ amountTotal: 1, receivedDate: '2020-01-01' },
{ amountTotal: 1, receivedDate: '2021-01-01' },
{ amountTotal: 1, receivedDate: '2020-01-01T18:00' },
{ amountTotal: 1, receivedDate: '2021-01-01T18:00' },
] as FormLeasePayment[],
},
],
Expand Down Expand Up @@ -345,7 +345,7 @@ describe('TermsForm component', () => {
{
...defaultTestFormLeaseTerm,
isTermExercised: false,
payments: [{ amountTotal: 1, receivedDate: '2020-01-01' }] as FormLeasePayment[],
payments: [{ amountTotal: 1, receivedDate: '2020-01-01T18:00' }] as FormLeasePayment[],
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const TermsForm: React.FunctionComponent<React.PropsWithChildren<ITermsFo
'receivedDate',
'desc',
);
const lastPaymentDate = allPayments.length ? prettyFormatDate(allPayments[0]?.receivedDate) : '';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch!

const lastPaymentDate = allPayments.length ? allPayments[0]?.receivedDate : '';

/** This is the payments subtable displayed for each term row. */
const renderPayments = useDeepCompareMemo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import { LeaseTermStatusTypes } from '@/constants/leaseStatusTypes';
import useKeycloakWrapper from '@/hooks/useKeycloakWrapper';
import { ISystemConstant } from '@/store/slices/systemConstants';
import { NumberFieldValue } from '@/typings/NumberFieldValue';
import { prettyFormatDate } from '@/utils';
import { stringToFragment } from '@/utils/columnUtils';
import { formatMoney } from '@/utils/numberFormatUtils';
import { prettyFormatDate } from '@/utils/utils';

import { FormLeaseTerm } from '../../models';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ exports[`AcquisitionView component renders as expected 1`] = `
>
Created:
<strong>
May 28, 2022
May 27, 2022
</strong>
by
<span
Expand All @@ -221,7 +221,7 @@ exports[`AcquisitionView component renders as expected 1`] = `
>
Last updated:
<strong>
Jul 28, 2022
Jul 27, 2022
</strong>
by
<span
Expand Down Expand Up @@ -751,7 +751,7 @@ exports[`AcquisitionView component renders as expected 1`] = `
<div
class="c18 text-left col"
>
Jun 27, 2022
Jun 26, 2022
</div>
</div>
<div
Expand Down Expand Up @@ -793,7 +793,7 @@ exports[`AcquisitionView component renders as expected 1`] = `
<div
class="c18 text-left col"
>
Jul 29, 2022
Jul 28, 2022
</div>
</div>
<div
Expand Down Expand Up @@ -1123,7 +1123,7 @@ exports[`AcquisitionView component renders as expected 1`] = `
target="_blank"
>
<span>
Millenium Inc
Millennium Inc
</span>
<svg
class="ml-2"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { FormikProps } from 'formik';
import { createRef } from 'react';

import { act, render, RenderOptions, userEvent, waitFor } from '@/utils/test-utils';
import { act, render, RenderOptions, userEvent } from '@/utils/test-utils';

import GenerateLetterRecipientsModal, {
IGenerateLetterRecipientsModalProps,
Expand All @@ -11,7 +11,7 @@ import { LetterRecipientsForm } from './models/LetterRecipientsForm';
const onGenerateLetterOk = jest.fn();
const onCancelClick = jest.fn();

describe('Expropriation Tab Container View', () => {
describe('GenerateLetterRecipients modal', () => {
const setup = async (
renderOptions: RenderOptions & { props?: Partial<IGenerateLetterRecipientsModalProps> },
) => {
Expand Down Expand Up @@ -41,17 +41,15 @@ describe('Expropriation Tab Container View', () => {
});

it('renders as expected', async () => {
const { asFragment } = await setup({});
expect(asFragment()).toMatchSnapshot();
await setup({});
expect(document.body).toMatchSnapshot();
});

it('should validate that at least one recipient is selected', async () => {
const { queryByTestId, getByText } = await setup({});
const saveButton = getByText('Continue');

await act(async () => {
await waitFor(() => userEvent.click(saveButton));
});
const saveButton = getByText('Continue');
await act(async () => userEvent.click(saveButton));

expect(queryByTestId('missing-recipient-error')).toBeInTheDocument();
expect(onGenerateLetterOk).toHaveBeenCalledTimes(0);
Expand Down
Loading
Loading