Skip to content

Commit

Permalink
Release v7.1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
mariia-aloshyna committed Nov 12, 2024
1 parent b3f179b commit 3a8c6ba
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 11 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Change history for ui-data-import

## **7.1.10** (in progress)
## [7.1.10](https://github.com/folio-org/ui-data-import/tree/v7.1.10) (2024-11-12)

### Bugs fixed:
* Change endpoint to get actual SRS MARC data (UIDATIMP-1597)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@folio/data-import",
"version": "7.1.9",
"version": "7.1.10",
"description": "Data Import manager",
"main": "src/index.js",
"repository": "folio-org/ui-data-import",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ ExistingSectionFolio.propTypes = {
label: PropTypes.string.isRequired,
})),
existingRecordFieldLabel: PropTypes.string,
formValues: PropTypes.object,
formValues: PropTypes.arrayOf(PropTypes.object),
};

ExistingSectionFolio.defaultProps = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import React from 'react';
import { fireEvent } from '@folio/jest-config-stripes/testing-library/react';
import {
fireEvent,
waitFor,
} from '@folio/jest-config-stripes/testing-library/react';
import { runAxeTest } from '@folio/stripes-testing';

import {
Expand All @@ -10,6 +13,7 @@ import {
import '../../../../../test/jest/__mock__';

import { ExistingSectionFolio } from './ExistingSectionFolio';
import userEvent from '@folio/jest-config-stripes/testing-library/user-event';

Check failure on line 16 in src/components/MatchCriterion/edit/ExistingRecordSections/ExistingSectionFolio.test.js

View workflow job for this annotation

GitHub Actions / github-actions-ci

`@***/jest-config-stripes/testing-library/user-event` import should occur before import of `../../../../../test/jest/helpers`

Check failure on line 16 in src/components/MatchCriterion/edit/ExistingRecordSections/ExistingSectionFolio.test.js

View workflow job for this annotation

GitHub Actions / github-actions-ci

`@***/jest-config-stripes/testing-library/user-event` import should occur before import of `../../../../../test/jest/helpers`

Check failure on line 16 in src/components/MatchCriterion/edit/ExistingRecordSections/ExistingSectionFolio.test.js

View workflow job for this annotation

GitHub Actions / github-actions-ci

`@***/jest-config-stripes/testing-library/user-event` import should occur before import of `../../../../../test/jest/helpers`

const onChangeFormStateMock = jest.fn(value => value);
const existingSectionFolioWithCorrectData = {
Expand Down Expand Up @@ -79,15 +83,17 @@ describe('ExistingSectionFolio edit component', () => {
await runAxeTest({ rootNode: container });
});

it('should render data options', () => {
const { getByText } = renderExistingSectionFolio(existingSectionFolioWithCorrectData);
it('should render data options', async () => {
const { getByRole, getByText } = renderExistingSectionFolio(existingSectionFolioWithCorrectData);

await waitFor(() => userEvent.click(getByRole('button')));

expect(getByText('test label1')).toBeDefined();
expect(getByText('test label2')).toBeDefined();
});

describe('when clicking on options element', () => {
it('with correct data, single value shouldn\'t be added', () => {
it('with correct data, single value shouldn\'t be added', async () => {
const fieldToChangePath = 'profile.matchDetails[0].existingMatchExpression.fields';
const fieldToChangeValue = [{
label: 'field',
Expand All @@ -97,21 +103,25 @@ describe('ExistingSectionFolio edit component', () => {
value: 'test value1',
}];

const { getByText } = renderExistingSectionFolio(existingSectionFolioWithCorrectData);
const { getByRole, getByText } = renderExistingSectionFolio(existingSectionFolioWithCorrectData);

await waitFor(() => userEvent.click(getByRole('button')));

const optionsElement = getByText('test label1');
fireEvent.click(optionsElement);

expect(onChangeFormStateMock).toHaveBeenCalledWith(fieldToChangePath, fieldToChangeValue);
});

it('with incorrect data, single value should be added', () => {
it('with incorrect data, single value should be added', async () => {
const fieldToChangePath = 'profile.matchDetails[0].existingMatchExpression.fields';
const fieldToChangeValue = [{
label: 'field',
value: 'instance.contributors[].name',
}];
const { getByText } = renderExistingSectionFolio(existingSectionFolioWithWrongData);
const { getByRole, getByText } = renderExistingSectionFolio(existingSectionFolioWithWrongData);

await waitFor(() => userEvent.click(getByRole('button')));

const optionsElement = getByText('test label2');
fireEvent.click(optionsElement);
Expand All @@ -121,15 +131,18 @@ describe('ExistingSectionFolio edit component', () => {
});

describe('when searching for an option', () => {
it('should filter data options', () => {
it('should filter data options', async () => {
const {
container,
getByPlaceholderText,
getByRole,
} = renderExistingSectionFolio(existingSectionFolioWithCorrectData);
const filterElement = getByPlaceholderText('Filter options list');

expect(filterElement).toHaveValue('');

await waitFor(() => userEvent.click(getByRole('button')));

fireEvent.change(filterElement, { target: { value: 'test label1' } });

const dropdownOptionsAmount = container.querySelector('.selectionList').children.length;
Expand Down

0 comments on commit 3a8c6ba

Please sign in to comment.