Skip to content

Commit

Permalink
Merge branch 'integrationTesting' into B-21557-INT-Estimated-Price
Browse files Browse the repository at this point in the history
  • Loading branch information
joeydoyecaci authored Dec 26, 2024
2 parents cc89606 + d938a1c commit 7bf2244
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
13 changes: 11 additions & 2 deletions src/components/Office/OrdersDetailForm/OrdersDetailForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { CheckboxField, DropdownInput, DatePickerInput, DutyLocationInput } from
import TextField from 'components/form/fields/TextField/TextField';
import MaskedTextField from 'components/form/fields/MaskedTextField/MaskedTextField';
import { DropdownArrayOf } from 'types/form';
import { SPECIAL_ORDERS_TYPES } from 'constants/orders';

const OrdersDetailForm = ({
deptIndicatorOptions,
Expand Down Expand Up @@ -82,12 +83,20 @@ const OrdersDetailForm = ({
<DropdownInput
name="ordersType"
label="Orders type"
options={formOrdersType === 'SAFETY' ? dropdownInputOptions({ SAFETY: 'Safety' }) : ordersTypeOptions}
options={
formOrdersType === SPECIAL_ORDERS_TYPES.SAFETY || formOrdersType === SPECIAL_ORDERS_TYPES.BLUEBARK
? dropdownInputOptions({ SAFETY: 'Safety', BLUEBARK: 'Bluebark' })
: ordersTypeOptions
}
onChange={(e) => {
setFormOrdersType(e.target.value);
setFieldValue('ordersType', e.target.value);
}}
isDisabled={formIsDisabled || formOrdersType === 'SAFETY'}
isDisabled={
formIsDisabled ||
formOrdersType === SPECIAL_ORDERS_TYPES.SAFETY ||
formOrdersType === SPECIAL_ORDERS_TYPES.BLUEBARK
}
/>
{showOrdersTypeDetail && (
<DropdownInput
Expand Down
18 changes: 17 additions & 1 deletion src/components/Office/OrdersDetailForm/OrdersDetailForm.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,23 @@ describe('OrdersDetailForm', () => {
showNTSTac: false,
showNTSSac: false,
showOrdersAcknowledgement: false,
ordersType: 'SAFETY',
ordersType: 'Safety',
});

// correct labels are visible
expect(await screen.findByLabelText('Orders type')).toBeDisabled();
});
it('has orders type dropdown disabled if bluebark move', async () => {
renderOrdersDetailForm({
showDepartmentIndicator: false,
showOrdersNumber: false,
showOrdersTypeDetail: false,
showHHGTac: false,
showHHGSac: false,
showNTSTac: false,
showNTSSac: false,
showOrdersAcknowledgement: false,
ordersType: 'BLUEBARK',
});

// correct labels are visible
Expand Down

0 comments on commit 7bf2244

Please sign in to comment.