diff --git a/src/Instance/InstanceDetails/InstanceAcquisition/InstanceAcquisition.test.js b/src/Instance/InstanceDetails/InstanceAcquisition/InstanceAcquisition.test.js index ebae04280..c57343359 100644 --- a/src/Instance/InstanceDetails/InstanceAcquisition/InstanceAcquisition.test.js +++ b/src/Instance/InstanceDetails/InstanceAcquisition/InstanceAcquisition.test.js @@ -16,11 +16,6 @@ import useInstanceAcquisition from './useInstanceAcquisition'; import * as utils from '../../../utils'; - -jest.mock('@folio/stripes/core', () => ({ - ...jest.requireActual('@folio/stripes/core'), - useStripes: jest.fn(), -})); jest.mock('./useInstanceAcquisition', () => jest.fn()); const spyOnIsUserInConsortiumMode = jest.spyOn(utils, 'isUserInConsortiumMode'); diff --git a/src/Instance/InstanceDetails/InstanceAcquisition/TenantAcquisition.js b/src/Instance/InstanceDetails/InstanceAcquisition/TenantAcquisition.js index 3b12106a9..f723b3b4b 100644 --- a/src/Instance/InstanceDetails/InstanceAcquisition/TenantAcquisition.js +++ b/src/Instance/InstanceDetails/InstanceAcquisition/TenantAcquisition.js @@ -9,38 +9,38 @@ import { } from '@folio/stripes/components'; import { getDateWithTime } from '../../../utils'; -import { COLUMN_NAMES } from '../../../constants'; +import { ACQISITION_COLUMN_NAMES } from '../../../constants'; const visibleColumns = [ - COLUMN_NAMES.poLineNumber, - COLUMN_NAMES.orderStatus, - COLUMN_NAMES.polReceiptStatus, - COLUMN_NAMES.dateOrdered, - COLUMN_NAMES.acqUnit, - COLUMN_NAMES.orderType, + ACQISITION_COLUMN_NAMES.poLineNumber, + ACQISITION_COLUMN_NAMES.orderStatus, + ACQISITION_COLUMN_NAMES.polReceiptStatus, + ACQISITION_COLUMN_NAMES.dateOrdered, + ACQISITION_COLUMN_NAMES.acqUnit, + ACQISITION_COLUMN_NAMES.orderType, ]; const columnMapping = { - [COLUMN_NAMES.poLineNumber]: , - [COLUMN_NAMES.orderStatus]: , - [COLUMN_NAMES.polReceiptStatus]: , - [COLUMN_NAMES.dateOrdered]: , - [COLUMN_NAMES.acqUnit]: , - [COLUMN_NAMES.orderType]: , + [ACQISITION_COLUMN_NAMES.poLineNumber]: , + [ACQISITION_COLUMN_NAMES.orderStatus]: , + [ACQISITION_COLUMN_NAMES.polReceiptStatus]: , + [ACQISITION_COLUMN_NAMES.dateOrdered]: , + [ACQISITION_COLUMN_NAMES.acqUnit]: , + [ACQISITION_COLUMN_NAMES.orderType]: , }; const formatter = { - [COLUMN_NAMES.poLineNumber]: i => {i.poLineNumber}, - [COLUMN_NAMES.orderStatus]: i => ( + [ACQISITION_COLUMN_NAMES.poLineNumber]: i => {i.poLineNumber}, + [ACQISITION_COLUMN_NAMES.orderStatus]: i => ( <> {i.order?.workflowStatus ? : } {i.order?.orderCloseReason?.reason && ` - ${i.order.orderCloseReason.reason}`} ), - [COLUMN_NAMES.polReceiptStatus]: i => , - [COLUMN_NAMES.dateOrdered]: i => getDateWithTime(i.order?.dateOrdered), - [COLUMN_NAMES.acqUnit]: i => i.order?.acqUnits?.map(u => u.name)?.join(', ') || , - [COLUMN_NAMES.orderType]: i => (i.order?.orderType ? : ), + [ACQISITION_COLUMN_NAMES.polReceiptStatus]: i => , + [ACQISITION_COLUMN_NAMES.dateOrdered]: i => getDateWithTime(i.order?.dateOrdered), + [ACQISITION_COLUMN_NAMES.acqUnit]: i => i.order?.acqUnits?.map(u => u.name)?.join(', ') || , + [ACQISITION_COLUMN_NAMES.orderType]: i => (i.order?.orderType ? : ), }; const TenantAcquisition = ({ diff --git a/src/constants.js b/src/constants.js index 60b7fab2e..1283891e4 100644 --- a/src/constants.js +++ b/src/constants.js @@ -725,7 +725,7 @@ export const LEADER_RECORD_STATUSES = { export const USER_TOUCHED_STAFF_SUPPRESS_STORAGE_KEY = 'folio_user_touched_staff_suppress'; -export const COLUMN_NAMES = { +export const ACQISITION_COLUMN_NAMES = { poLineNumber: 'poLineNumber', orderStatus: 'orderStatus', polReceiptStatus: 'polReceiptStatus', diff --git a/test/jest/__mock__/stripesCore.mock.js b/test/jest/__mock__/stripesCore.mock.js index 25b8a169f..4f931063c 100644 --- a/test/jest/__mock__/stripesCore.mock.js +++ b/test/jest/__mock__/stripesCore.mock.js @@ -83,7 +83,7 @@ const mockStripesCore = { extend: jest.fn().mockReturnValue(this), }), - useStripes: () => STRIPES, + useStripes: jest.fn(() => STRIPES), withStripes: Component => ({ stripes, ...rest }) => { const fakeStripes = stripes || STRIPES;