Skip to content

Commit

Permalink
cleanup lint errors (#7618)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacquelineIO committed Oct 22, 2021
1 parent 8743fcc commit d116d12
Showing 1 changed file with 1 addition and 102 deletions.
103 changes: 1 addition & 102 deletions src/pages/PrimeUI/Shipment/PrimeUIShipmentUpdate.test.jsx
@@ -1,20 +1,15 @@
import React from 'react';
import { act, render, screen, waitFor, within } from '@testing-library/react';
import { render, screen, waitFor, within } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { generatePath } from 'react-router';

import { primeSimulatorRoutes } from '../../../constants/routes';
import { MockProviders } from '../../../testUtils';
import { usePrimeSimulatorGetMove } from '../../../hooks/queries';
import { updatePrimeMTOShipment } from '../../../services/primeApi';
import MOVE_STATUSES from '../../../constants/moves';
import { ORDERS_TYPE, ORDERS_TYPE_DETAILS } from '../../../constants/orders';

import PrimeUIShipmentUpdate from './PrimeUIShipmentUpdate';

import { shipmentStatuses } from 'constants/shipments';

const mockRequestedMoveCode = 'LR4T8V';
const shipmentId = 'ce01a5b8-9b44-4511-8a8d-edb60f2a4aee';
const moveId = '9c7b255c-2981-4bf8-839f-61c7458e2b4d';

Expand Down Expand Up @@ -224,26 +219,6 @@ const approvedMoveTaskOrder = {
},
};

const missingPrimeUpdates = {
...approvedMoveTaskOrder,
moveTaskOrder: {
id: '9c7b255c-2981-4bf8-839f-61c7458e2b4d',
ordersId: '1',
status: MOVE_STATUSES.APPROVED,
mtoShipments: [
{
id: 'ce01a5b8-9b44-4511-8a8d-edb60f2a4aee',
moveTaskOrderID: '9c7b255c-2981-4bf8-839f-61c7458e2b4d',
destinationAddress: null,
primeEstimatedWeight: 0,
primeActualWeight: 0,
scheduledPickupDate: null,
actualPickupDate: null,
},
],
},
};

/*
const tooApprovedMoveDetailsQuery = {
...newMoveDetailsQuery,
Expand Down Expand Up @@ -272,14 +247,6 @@ const updateShipmentURL = generatePath(primeSimulatorRoutes.UPDATE_SHIPMENT_PATH
});
const moveDetailsURL = generatePath(primeSimulatorRoutes.VIEW_MOVE_PATH, { moveCodeOrID: moveId });

const renderMockedComponent = () => {
return render(
<MockProviders initialEntries={[updateShipmentURL]}>
<PrimeUIShipmentUpdate />
</MockProviders>,
);
};

const mockedComponent = (
<MockProviders initialEntries={[updateShipmentURL]}>
<PrimeUIShipmentUpdate />
Expand Down Expand Up @@ -307,74 +274,6 @@ const errorReturnValue = {
isSuccess: false,
};

const returnPayload = {
mtoShipments: {
'c865e3c9-734e-4769-af70-72a52a5720ff': {
actualPickupDate: '2020-03-16',
agents: [
{
agentType: 'RELEASING_AGENT',
createdAt: '2021-10-18T18:24:42.671Z',
eTag: 'MjAyMS0xMC0yMFQxNDoyMzoxOC4xODIyNDla',
email: 'test@test.email.com',
firstName: 'Test',
id: 'fb4f192f-3731-438d-a2f6-6e23f7e4a1ca',
lastName: 'Agent',
mtoShipmentID: 'c865e3c9-734e-4769-af70-72a52a5720ff',
phone: '202-555-9301',
updatedAt: '2021-10-20T14:23:18.182Z',
},
],
approvedDate: '2021-10-18',
createdAt: '2021-10-18T18:24:42.530Z',
customerRemarks: 'Please treat gently',
destinationAddress: {
city: 'Fairfield',
country: 'US',
eTag: 'MjAyMS0xMC0yMFQxNDoyMzoxOC4xODIyNDha',
id: 'b7d93542-ae63-42b6-8000-f6b7c120f860',
postalCode: '94535',
},
eTag: 'MjAyMS0xMC0yMFQxNDoyMzoxOC4xODIyNDla',
firstAvailableDeliveryDate: null,
id: 'c865e3c9-734e-4769-af70-72a52a5720ff',
moveTaskOrderID: 'f0f5aa92-a146-41b3-9a07-bd164c7c484a',
mtoServiceItems: [
{
0: {
eTag: 'MjAyMS0xMC0xOFQxODoyNDo0Mi42Nzk4NDla',
id: 'b00f5fd4-b8cb-43ff-aa27-8f39615ea086',
modelType: 'MTOServiceItemBasic',
moveTaskOrderID: 'f0f5aa92-a146-41b3-9a07-bd164c7c484a',
mtoShipmentID: 'c865e3c9-734e-4769-af70-72a52a5720ff',
reServiceCode: 'STEST',
reServiceName: 'Test Service',
status: 'APPROVED',
},
},
],
pickupAddress: {
city: 'Beverly Hills',
country: 'US',
eTag: 'MjAyMS0xMC0yMFQxNDoyMzoxOC4xODU3Njha',
id: '5e98f9eb-89dd-40a2-bab5-bdd82b8ecb9d',
postalCode: '90210',
},
primeActualWeight: 10000,
primeEstimatedWeight: 1400,
primeEstimatedWeightRecordedDate: null,
requestedPickupDate: '2020-03-15',
requiredDeliveryDate: '2020-03-28',
scheduledPickupDate: '2020-03-16',
secondaryDeliveryAddress: { city: null, postalCode: null, state: null, streetAddress1: null },
secondaryPickupAddress: { city: null, postalCode: null, state: null, streetAddress1: null },
shipmentType: 'HHG_LONGHAUL_DOMESTIC',
status: 'SUBMITTED',
updatedAt: '2021-10-20T14:23:18.182Z',
},
},
};

describe('Update Shipment Page', () => {
it('renders the page without errors', async () => {
usePrimeSimulatorGetMove.mockReturnValue(readyReturnValue);
Expand Down

0 comments on commit d116d12

Please sign in to comment.