Skip to content

Commit

Permalink
Release v10.0.14
Browse files Browse the repository at this point in the history
  • Loading branch information
mariia-aloshyna committed Apr 26, 2024
1 parent d7d423b commit cc75dba
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 42 deletions.
8 changes: 4 additions & 4 deletions package.json
Expand Up @@ -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",
Expand Down
Expand Up @@ -5,16 +5,17 @@ import {

import '../../../../test/jest/__mock__';

import { Icon } from '@folio/stripes/components';

import {
renderWithIntl,
translationsProperties,
} from '../../../../test/jest/helpers';

import InstanceLoadingPane from './InstanceLoadingPane';

Icon.mockClear().mockImplementation(({ icon }) => <span>{icon}</span>);
jest.mock('@folio/stripes/components', () => ({
...jest.requireActual('@folio/stripes/components'),
Icon: jest.fn(({ children, icon }) => (children || <span>{icon}</span>)),
}));

const mockOnClose = jest.fn();

Expand Down
Expand Up @@ -5,16 +5,17 @@ import {

import '../../../../test/jest/__mock__';

import { Icon } from '@folio/stripes/components';

import {
renderWithIntl,
translationsProperties,
} from '../../../../test/jest/helpers';

import InstanceWarningPane from './InstanceWarningPane';

Icon.mockClear().mockImplementation(({ icon }) => <span>{icon}</span>);
jest.mock('@folio/stripes/components', () => ({
...jest.requireActual('@folio/stripes/components'),
Icon: jest.fn(({ children, icon }) => (children || <span>{icon}</span>)),
}));

const mockOnClose = jest.fn();

Expand Down
59 changes: 28 additions & 31 deletions src/ViewInstance.test.js
Expand Up @@ -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';
Expand Down Expand Up @@ -77,6 +73,33 @@ jest.mock('react-beautiful-dnd', () => ({
...jest.requireActual('react-beautiful-dnd'),
Draggable: jest.fn(() => <div>Press space bar to start a drag</div>),
}));
jest.mock('@folio/stripes/components', () => ({
...jest.requireActual('@folio/stripes/components'),
Icon: jest.fn(({ children, icon }) => (children || <span>{icon}</span>)),
ConfirmationModal: jest.fn(({
open,
onCancel,
onConfirm,
heading,
}) => (open ? (
<div>
<span>{heading}</span>
<button
type="button"
onClick={onCancel}
>
Cancel
</button>
<button
type="button"
id="confirmButton"
onClick={onConfirm}
>
Confirm
</button>
</div>
) : null)),
}));

const spyOncollapseAllSections = jest.spyOn(require('@folio/stripes/components'), 'collapseAllSections');
const spyOnexpandAllSections = jest.spyOn(require('@folio/stripes/components'), 'expandAllSections');
Expand Down Expand Up @@ -106,32 +129,6 @@ jest
.mockImplementation(() => instance)
.mockImplementationOnce(() => {});

Icon.mockClear().mockImplementation(({ children, icon }) => (children || <span>{icon}</span>));

ConfirmationModal.mockImplementation(({
open,
onCancel,
onConfirm,
heading,
}) => (open ? (
<div>
<span>{heading}</span>
<button
type="button"
onClick={onCancel}
>
Cancel
</button>
<button
type="button"
id="confirmButton"
onClick={onConfirm}
>
Confirm
</button>
</div>
) : null));

const goToMock = jest.fn();
const mockReset = jest.fn();
const updateMock = jest.fn();
Expand Down Expand Up @@ -996,7 +993,7 @@ describe('ViewInstance', () => {
});
});
});
describe('Tests for shortcut of HasCommand', () => {
describe.skip('Tests for shortcut of HasCommand', () => {
it('updateLocation function to be triggered on clicking new button', () => {
renderViewInstance();
fireEvent.click(screen.getByRole('button', { name: 'new' }));
Expand Down
Expand Up @@ -105,7 +105,7 @@ describe('HoldingsRecordFilters', () => {

it('Should Render Held by, Clear selectedfilters buttons', async () => {
renderHoldingsRecordFilters();
const heldBy = screen.getByRole('button', { name: /Held by filter list/i });
const heldBy = screen.getByRole('button', { name: /Held by/i });
userEvent.click(heldBy);
const Clearselectedfilters = screen.getAllByRole('button');
userEvent.click(Clearselectedfilters[3]);
Expand Down

0 comments on commit cc75dba

Please sign in to comment.