diff --git a/package.json b/package.json index b1747d983..6d6dbde1d 100644 --- a/package.json +++ b/package.json @@ -862,10 +862,10 @@ "@folio/jest-config-stripes": "^2.0.0", "@folio/stripes": "^9.0.0", "@folio/stripes-cli": "^3.0.0", - "@folio/stripes-components": "^12.0.0", - "@folio/stripes-connect": "^9.0.0", - "@folio/stripes-core": "^10.0.0", - "@folio/stripes-smart-components": "^9.0.0", + "@folio/stripes-components": "~12.0.0", + "@folio/stripes-connect": "~9.0.0", + "@folio/stripes-core": "~10.0.0", + "@folio/stripes-smart-components": "~9.0.0", "@folio/stripes-testing": "^4.6.0", "@folio/stripes-util": "^6.0.0", "@formatjs/cli": "^6.1.3", diff --git a/src/Instance/InstanceDetails/InstanceLoadingPane/InstanceLoadingPane.test.js b/src/Instance/InstanceDetails/InstanceLoadingPane/InstanceLoadingPane.test.js index a8f1e7bc8..b492854be 100644 --- a/src/Instance/InstanceDetails/InstanceLoadingPane/InstanceLoadingPane.test.js +++ b/src/Instance/InstanceDetails/InstanceLoadingPane/InstanceLoadingPane.test.js @@ -5,8 +5,6 @@ import { import '../../../../test/jest/__mock__'; -import { Icon } from '@folio/stripes/components'; - import { renderWithIntl, translationsProperties, @@ -14,7 +12,10 @@ import { import InstanceLoadingPane from './InstanceLoadingPane'; -Icon.mockClear().mockImplementation(({ icon }) => {icon}); +jest.mock('@folio/stripes/components', () => ({ + ...jest.requireActual('@folio/stripes/components'), + Icon: jest.fn(({ children, icon }) => (children || {icon})), +})); const mockOnClose = jest.fn(); diff --git a/src/Instance/InstanceDetails/InstanceWarningPane/InstanceWarningPane.test.js b/src/Instance/InstanceDetails/InstanceWarningPane/InstanceWarningPane.test.js index bb4603a2d..a1e5f1d67 100644 --- a/src/Instance/InstanceDetails/InstanceWarningPane/InstanceWarningPane.test.js +++ b/src/Instance/InstanceDetails/InstanceWarningPane/InstanceWarningPane.test.js @@ -5,8 +5,6 @@ import { import '../../../../test/jest/__mock__'; -import { Icon } from '@folio/stripes/components'; - import { renderWithIntl, translationsProperties, @@ -14,7 +12,10 @@ import { import InstanceWarningPane from './InstanceWarningPane'; -Icon.mockClear().mockImplementation(({ icon }) => {icon}); +jest.mock('@folio/stripes/components', () => ({ + ...jest.requireActual('@folio/stripes/components'), + Icon: jest.fn(({ children, icon }) => (children || {icon})), +})); const mockOnClose = jest.fn(); diff --git a/src/ViewInstance.test.js b/src/ViewInstance.test.js index 0d7e24d72..7947ab9d5 100644 --- a/src/ViewInstance.test.js +++ b/src/ViewInstance.test.js @@ -18,10 +18,6 @@ import { checkIfUserInMemberTenant, checkIfUserInCentralTenant, } from '@folio/stripes/core'; -import { - ConfirmationModal, - Icon, -} from '@folio/stripes/components'; import { instances } from '../test/fixtures/instances'; import { DataContext } from './contexts'; @@ -77,6 +73,33 @@ jest.mock('react-beautiful-dnd', () => ({ ...jest.requireActual('react-beautiful-dnd'), Draggable: jest.fn(() =>