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

B 18328 update too pickupdate #12006

Merged
merged 7 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/components/Office/ShipmentDetails/ShipmentDetailsMain.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ const ShipmentDetailsMain = ({
requiredDeliveryDate,
pickupAddress,
destinationAddress,
ppmShipment,
primeEstimatedWeight,
primeActualWeight,
counselorRemarks,
Expand Down Expand Up @@ -124,6 +125,7 @@ const ShipmentDetailsMain = ({

let displayedPickupAddress;
let displayedDeliveryAddress;
let actualMoveDate;

switch (shipmentType) {
case SHIPMENT_OPTIONS.HHG:
Expand All @@ -138,6 +140,9 @@ const ShipmentDetailsMain = ({
displayedPickupAddress = storageFacility ? storageFacility.address : null;
displayedDeliveryAddress = destinationAddress;
break;
case SHIPMENT_OPTIONS.PPM:
actualMoveDate = ppmShipment.actualMoveDate;
break;
default:
displayedPickupAddress = pickupAddress;
displayedDeliveryAddress = destinationAddress || destinationDutyLocationAddress;
Expand Down Expand Up @@ -182,6 +187,12 @@ const ShipmentDetailsMain = ({
openConvertModalButton={openConvertModalButton}
/>
)}
{shipmentType === SHIPMENT_OPTIONS.PPM && (
<ImportantShipmentDates
actualMoveDate={actualMoveDate ? formatDateWithUTC(actualMoveDate) : null}
actualDeliveryDate={actualMoveDate ? formatDateWithUTC(actualMoveDate) : null}
/>
)}
<ImportantShipmentDates
requestedPickupDate={requestedPickupDate ? formatDateWithUTC(requestedPickupDate) : null}
scheduledPickupDate={scheduledPickupDate ? formatDateWithUTC(scheduledPickupDate) : null}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import { futureSITShipment, noSITShipment, SITShipment } from '../ShipmentSITDis

import ShipmentDetailsMain from './ShipmentDetailsMain';

import { createPPMShipmentWithFinalIncentive } from 'utils/test/factories/ppmShipment';
import { MockProviders } from 'testUtils';
import { formatDateWithUTC } from 'shared/dates';

const shipmentDetailsMainParams = {
handleDivertShipment: () => {},
Expand Down Expand Up @@ -51,3 +53,22 @@ describe('Shipment Details Main', () => {
expect(screen.queryByText('SIT (STORAGE IN TRANSIT)')).not.toBeInTheDocument();
});
});
it('does display PPM shipment', () => {
const ppmShipment = createPPMShipmentWithFinalIncentive({
ppmShipment: {
expectedDepartureDate: '2024-01-01',
actualMoveDate: '2024-02-22',
estimatedWeight: 100,
shipment: {
estimatedIncentive: 2000,
},
},
});
render(
<MockProviders>
<ShipmentDetailsMain {...shipmentDetailsMainParams} shipment={ppmShipment} />
</MockProviders>,
);

expect(screen.queryByText(formatDateWithUTC('2-22-2024'))).toBeInTheDocument();
});
Loading