diff --git a/config/env/loadtest.app.env b/config/env/loadtest.app.env index 36e8d78e379..aa854ba5491 100644 --- a/config/env/loadtest.app.env +++ b/config/env/loadtest.app.env @@ -8,7 +8,7 @@ DB_USER=crud DEBUG_PPROF=false DEVLOCAL_AUTH=true DOD_CA_PACKAGE=/config/tls/api.loadtest.dp3.us.chain.der.p7b -DTOD_USE_MOCK=true +DTOD_USE_MOCK=false EMAIL_BACKEND=ses FEATURE_FLAG_SERVER_URL=http://flipt.svc-loadtest.local:8080 HEALTH_SERVER_ENABLED=true diff --git a/src/components/Customer/MobileHomeShipment/MobileHomeShipmentForm/MobileHomeShipmentForm.jsx b/src/components/Customer/MobileHomeShipment/MobileHomeShipmentForm/MobileHomeShipmentForm.jsx index 51364fc0d3a..3807200ac0a 100644 --- a/src/components/Customer/MobileHomeShipment/MobileHomeShipmentForm/MobileHomeShipmentForm.jsx +++ b/src/components/Customer/MobileHomeShipment/MobileHomeShipmentForm/MobileHomeShipmentForm.jsx @@ -271,8 +271,8 @@ const MobileHomeShipmentForm = ({ mtoShipment, onBack, onSubmit }) => { Example diff --git a/src/components/Office/RequestedShipments/ApprovedRequestedShipments.jsx b/src/components/Office/RequestedShipments/ApprovedRequestedShipments.jsx index 1c06b0e47fb..635932cf4f1 100644 --- a/src/components/Office/RequestedShipments/ApprovedRequestedShipments.jsx +++ b/src/components/Office/RequestedShipments/ApprovedRequestedShipments.jsx @@ -87,33 +87,35 @@ const ApprovedRequestedShipments = ({ return (
-

Approved Shipments

-
- {!isMoveLocked && ( - - - - - - - - - - - - )} +
+

Approved Shipments

+
+ {!isMoveLocked && ( + + + + + + + + + + + + )} +
diff --git a/src/components/Office/RequestedShipments/RequestedShipments.module.scss b/src/components/Office/RequestedShipments/RequestedShipments.module.scss index f31b6404971..0e488e96bf3 100644 --- a/src/components/Office/RequestedShipments/RequestedShipments.module.scss +++ b/src/components/Office/RequestedShipments/RequestedShipments.module.scss @@ -7,6 +7,19 @@ @include u-padding-x(4); @include u-padding-y(2); + .sectionHeader { + display: flex; + justify-content: center; + align-items: center; + h2 { + margin-right: auto; + } + + .buttonDropdown { + margin-left: auto + } + } + h4 { @include u-margin(0); font-weight: bold; @@ -55,7 +68,3 @@ .serviceCounselingCompleted { @include u-margin-top(3); } - -.dropdownButton { - float: right; -} diff --git a/src/components/Office/RequestedShipments/SubmittedRequestedShipments.jsx b/src/components/Office/RequestedShipments/SubmittedRequestedShipments.jsx index 1863212805c..a3108c76a5a 100644 --- a/src/components/Office/RequestedShipments/SubmittedRequestedShipments.jsx +++ b/src/components/Office/RequestedShipments/SubmittedRequestedShipments.jsx @@ -223,33 +223,35 @@ const SubmittedRequestedShipments = ({
-

Requested shipments

-
- {!isMoveLocked && ( - - - - - - - - - - - - )} +
+

Requested shipments

+
+ {!isMoveLocked && ( + + + + + + + + + + + + )} +
{mtoShipments && diff --git a/src/pages/PrimeUI/Shipment/PrimeUIShipmentCreate.test.jsx b/src/pages/PrimeUI/Shipment/PrimeUIShipmentCreate.test.jsx index a7487d9f68f..019647164d3 100644 --- a/src/pages/PrimeUI/Shipment/PrimeUIShipmentCreate.test.jsx +++ b/src/pages/PrimeUI/Shipment/PrimeUIShipmentCreate.test.jsx @@ -81,37 +81,40 @@ describe('successful submission of form', () => { }); }); -describe('Create PPM', () => { - it('test destination address street 1 is OPTIONAL', async () => { - createPrimeMTOShipmentV3.mockReturnValue({}); +describe('Error when submitting', () => { + it('Correctly displays the unexpected server error window when an unusuable api error response is returned', async () => { + createPrimeMTOShipmentV3.mockRejectedValue('malformed api error response'); + render(mockedComponent); + + waitFor(async () => { + await userEvent.selectOptions(screen.getByLabelText('Shipment type'), 'HHG'); + + const saveButton = await screen.getByRole('button', { name: 'Save' }); + + expect(saveButton).not.toBeDisabled(); + await userEvent.click(saveButton); + expect(screen.getByText('Unexpected error')).toBeInTheDocument(); + expect( + screen.getByText('An unknown error has occurred, please check the address values used'), + ).toBeInTheDocument(); + }); + }); + it('Correctly displays the invalid fields in the error window when an api error response is returned', async () => { + createPrimeMTOShipmentV3.mockRejectedValue({ body: { title: 'Error', invalidFields: { someField: true } } }); render(mockedComponent); - await userEvent.selectOptions(screen.getByLabelText('Shipment type'), 'PPM'); - - // Start controlled test case to verify everything is working. - let input = await document.querySelector('input[name="ppmShipment.pickupAddress.streetAddress1"]'); - expect(input).toBeInTheDocument(); - // enter required street 1 for pickup - await userEvent.type(input, '123 Street'); - // clear - await userEvent.clear(input); - await userEvent.tab(); - // verify Required alert is displayed - const requiredAlerts = screen.getByRole('alert'); - expect(requiredAlerts).toHaveTextContent('Required'); - // make valid again to clear alert - await userEvent.type(input, '123 Street'); - - // Verify destination address street 1 is OPTIONAL. - input = await document.querySelector('input[name="ppmShipment.destinationAddress.streetAddress1"]'); - expect(input).toBeInTheDocument(); - // enter something - await userEvent.type(input, '123 Street'); - // clear - await userEvent.clear(input); - await userEvent.tab(); - // verify no validation is displayed after clearing destination address street 1 because it's OPTIONAL - expect(screen.queryByRole('alert')).not.toBeInTheDocument(); + waitFor(async () => { + await userEvent.selectOptions(screen.getByLabelText('Shipment type'), 'HHG'); + + const saveButton = await screen.getByRole('button', { name: 'Save' }); + + expect(saveButton).not.toBeDisabled(); + await userEvent.click(saveButton); + expect(screen.getByText('Prime API: Error')).toBeInTheDocument(); + expect( + screen.getByText('An unknown error has occurred, please check the address values used'), + ).toBeInTheDocument(); + }); }); });