Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
r-mettler committed Jan 30, 2024
1 parent 813b5f6 commit f068681
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import formStyles from 'styles/form.module.scss';
import { DutyLocationShape } from 'types';
import { MoveShape, ServiceMemberShape } from 'types/customerShapes';
import { ShipmentShape } from 'types/shipment';
import { ZIP5_CODE_REGEX } from 'utils/validation';
import { searchTransportationOffices } from 'services/internalApi';
import SERVICE_MEMBER_AGENCIES from 'content/serviceMemberAgencies';
import { AddressFields } from 'components/form/AddressFields/AddressFields';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,17 +165,11 @@ describe('DateAndLocation component', () => {
renderDateAndLocation();

await act(async () => {
await userEvent.type(
document.querySelector('input[name="pickupAddress.address.postalCode"]'),
'10001',
);
await userEvent.type(document.querySelector('input[name="pickupAddress.address.postalCode"]'), '10001');
});

await act(async () => {
await userEvent.type(
document.querySelector('input[name="destinationAddress.address.postalCode"]'),
'10002',
);
await userEvent.type(document.querySelector('input[name="destinationAddress.address.postalCode"]'), '10002');
});

await userEvent.type(screen.getByLabelText('When do you plan to start moving your PPM?'), '04 Jul 2022');
Expand Down Expand Up @@ -214,17 +208,11 @@ describe('DateAndLocation component', () => {
renderDateAndLocation();

await act(async () => {
await userEvent.type(
document.querySelector('input[name="pickupAddress.address.postalCode"]'),
'10001',
);
await userEvent.type(document.querySelector('input[name="pickupAddress.address.postalCode"]'), '10001');
});

await act(async () => {
await userEvent.type(
document.querySelector('input[name="destinationAddress.address.postalCode"]'),
'10002',
);
await userEvent.type(document.querySelector('input[name="destinationAddress.address.postalCode"]'), '10002');
});

await userEvent.type(screen.getByLabelText('When do you plan to start moving your PPM?'), '04 Jul 2022');
Expand Down Expand Up @@ -268,10 +256,7 @@ describe('DateAndLocation component', () => {
});

await act(async () => {
await userEvent.type(
document.querySelector('input[name="pickupAddress.address.postalCode"]'),
'10001',
);
await userEvent.type(document.querySelector('input[name="pickupAddress.address.postalCode"]'), '10001');
});

await act(async () => {
Expand All @@ -282,10 +267,7 @@ describe('DateAndLocation component', () => {
});

await act(async () => {
await userEvent.type(
document.querySelector('input[name="destinationAddress.address.postalCode"]'),
'10002',
);
await userEvent.type(document.querySelector('input[name="destinationAddress.address.postalCode"]'), '10002');
});

await act(async () => {
Expand Down Expand Up @@ -376,17 +358,11 @@ describe('DateAndLocation component', () => {

// Fill in form
await act(async () => {
await userEvent.type(
document.querySelector('input[name="pickupAddress.address.postalCode"]'),
'10001',
);
await userEvent.type(document.querySelector('input[name="pickupAddress.address.postalCode"]'), '10001');
});

await act(async () => {
await userEvent.type(
document.querySelector('input[name="destinationAddress.address.postalCode"]'),
'10002',
);
await userEvent.type(document.querySelector('input[name="destinationAddress.address.postalCode"]'), '10002');
});

await userEvent.type(screen.getByLabelText('When do you plan to start moving your PPM?'), '04 Jul 2022');
Expand Down Expand Up @@ -426,17 +402,11 @@ describe('DateAndLocation component', () => {

// Fill in form
await act(async () => {
await userEvent.type(
document.querySelector('input[name="pickupAddress.address.postalCode"]'),
'10001',
);
await userEvent.type(document.querySelector('input[name="pickupAddress.address.postalCode"]'), '10001');
});

await act(async () => {
await userEvent.type(
document.querySelector('input[name="destinationAddress.address.postalCode"]'),
'10002',
);
await userEvent.type(document.querySelector('input[name="destinationAddress.address.postalCode"]'), '10002');
});

await userEvent.type(screen.getByLabelText('When do you plan to start moving your PPM?'), '04 Jul 2022');
Expand Down Expand Up @@ -476,17 +446,11 @@ describe('DateAndLocation component', () => {

// Fill in form
await act(async () => {
await userEvent.type(
document.querySelector('input[name="pickupAddress.address.postalCode"]'),
'10001',
);
await userEvent.type(document.querySelector('input[name="pickupAddress.address.postalCode"]'), '10001');
});

await act(async () => {
await userEvent.type(
document.querySelector('input[name="destinationAddress.address.postalCode"]'),
'10002',
);
await userEvent.type(document.querySelector('input[name="destinationAddress.address.postalCode"]'), '10002');
});

await userEvent.type(screen.getByLabelText('When do you plan to start moving your PPM?'), '04 Jul 2022');
Expand Down

0 comments on commit f068681

Please sign in to comment.