diff --git a/src/edit/holdings/HoldingsForm.test.js b/src/edit/holdings/HoldingsForm.test.js
index bc683fb4b..42d6b89af 100644
--- a/src/edit/holdings/HoldingsForm.test.js
+++ b/src/edit/holdings/HoldingsForm.test.js
@@ -1,21 +1,18 @@
import React from 'react';
import { BrowserRouter as Router } from 'react-router-dom';
+import PropTypes from 'prop-types';
+import { screen } from '@folio/jest-config-stripes/testing-library/react';
+import userEvent from '@folio/jest-config-stripes/testing-library/user-event';
import {
QueryClient,
QueryClientProvider,
} from 'react-query';
-import { fireEvent } from '@folio/jest-config-stripes/testing-library/react';
import '../../../test/jest/__mock__';
-
-import { StripesContext } from '@folio/stripes/core';
-
-import {
- renderWithIntl,
- translationsProperties,
- stripesStub,
-} from '../../../test/jest/helpers';
-import { DataContext } from '../../contexts';
+import stripesFinalForm from '@folio/stripes/final-form';
+import renderWithRouter from '../../../test/jest/helpers/renderWithRouter';
+import renderWithIntl from '../../../test/jest/helpers/renderWithIntl';
+import translationsProperties from '../../../test/jest/helpers/translationsProperties';
import HoldingsForm from './HoldingsForm';
@@ -33,124 +30,163 @@ const mockInitialValues = {
id: 'id',
permanentLocationId: 'permanentLocationId',
};
-const mockOnSubmit = jest.fn();
+
const mockOnCancel = jest.fn();
+
const mockInstance = {};
+
const mockReferenceTables = {
- holdingsNoteTypes: [{ id: 'holdingsNoteTypeId', name: 'holdingsNoteTypeId' }],
- callNumberTypes: [{ id: 'callNumberTypeId', name: 'callNumberTypeId' }],
- holdingsTypes: [{ id: 'holdingsTypeId', name: 'holdingsTypeId' }],
- holdingsSources: [{ id: 'MARC', name: 'MARC' }],
- holdingsSourcesByName: { MARC: { name: 'MARC' } },
- statisticalCodes: [{ id: 'statisticalCodeId', name: 'statisticalCodeId', code: 'statisticalCode' }],
- illPolicies: [{ id: 'illPolicyId', name: 'illPolicyId' }],
- electronicAccessRelationships: [],
+ holdingsNoteTypes: [
+ { id: '1', name: 'Note Type 1' },
+ { id: '2', name: 'Note Type 2' },
+ ],
+ callNumberTypes: [
+ { id: '1', name: 'Call Number Type 1' },
+ { id: '2', name: 'Call Number Type 2' },
+ ],
+ holdingsTypes: [
+ { id: '1', name: 'Holdings Type 1' },
+ { id: '2', name: 'Holdings Type 2' },
+ ],
+ holdingsSources: [
+ { id: '1', name: 'Holdings Source 1' },
+ { id: '2', name: 'Holdings Source 2' },
+ ],
+ holdingsSourcesByName: {
+ FOLIO: { name: 'Holdings Source FOLIO' },
+ },
+ statisticalCodes: [
+ { id: '1', code: 'Code 1', name: 'Statistical Code 1', statisticalCodeTypeId: '1' },
+ { id: '2', code: 'Code 2', name: 'Statistical Code 2', statisticalCodeTypeId: '2' },
+ ],
+ statisticalCodeTypes: [
+ { id: '1', name: 'Statistical Code Type 1' },
+ { id: '2', name: 'Statistical Code Type 2' },
+ ],
+ illPolicies: [
+ { id: '1', name: 'ILL Policy 1' },
+ { id: '2', name: 'ILL Policy 2' },
+ ],
+ electronicAccessRelationships: [
+ { id: '1', name: 'electronic Access Relationships 1' },
+ { id: '2', name: 'electronic Access Relationships 2' },
+ ],
};
-const mockBlockedFields = [
- 'shelvingTitle',
-];
+
const mockResources = {
holdingsBlockedFields: {
hasLoaded: true,
- records: [{
- blockedFields: mockBlockedFields,
- }],
+ records: [
+ {
+ blockedFields: ['field1', 'field2'],
+ },
+ ],
},
};
+
const mockItemCount = 0;
-const mockGoTo = jest.fn();
-
-const queryClient = new QueryClient();
-
-const HoldingsFormSetup = (props = {}) => (
-