Skip to content

Commit

Permalink
Merge branch 'master' into UIREQ-1199
Browse files Browse the repository at this point in the history
  • Loading branch information
artem-blazhko authored Dec 16, 2024
2 parents 8804d18 + cab7e2f commit 3b483dc
Show file tree
Hide file tree
Showing 41 changed files with 992 additions and 90 deletions.
21 changes: 20 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
# Change history for ui-requests

## 11.0.0 (IN PROGRESS)
## [11.1.0] IN PROGRESS

* Add optional column "Retrieval service point" to requests search list. Refs UIREQ-1188.
* Increase code coverage for src/ChooseRequestTypeDialog.js by Jest/RTL tests. Refs UIREQ-1044.
* Cleanup retrieval service point implementation from deprecated folder. Refs UIREQ-1211.
* Increase code coverage for src/ViewRequest.js by Jest/RTL tests. Refs UIREQ-1046.

## [11.0.2] (https://github.com/folio-org/ui-requests/tree/v11.0.2) (2024-12-10)
[Full Changelog](https://github.com/folio-org/ui-requests/compare/v11.0.1...v11.0.2)

* Migrate from `mod-circulation` to `mod-circulation-bff` for `Print pick slips` and `Print search slips`. Refs UIREQ-1154.

## [11.0.1] (https://github.com/folio-org/ui-requests/tree/v11.0.1) (2024-12-02)
[Full Changelog](https://github.com/folio-org/ui-requests/compare/v11.0.0...v11.0.1)

* Remove "circulation-bff-requests" okapi interface. Refs UIREQ-1203.

## [11.0.0] (https://github.com/folio-org/ui-requests/tree/v11.0.0) (2024-11-30)
[Full Changelog](https://github.com/folio-org/ui-requests/compare/v10.0.2...v11.0.0)

* Consistency update permission after change them in mod-circulation. Refs UIREQ-1194.
* Use settings/entries endpoint to get settings information. Refs UIREQ-1062.
* Requests app.: Editing requests (ECS with mod-tlr enabled). Refs UIREQ-1088.
Expand Down
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@folio/requests",
"version": "11.0.0",
"version": "11.1.0",
"description": "Requests manager",
"repository": "folio-org/ui-requests",
"publishConfig": {
Expand Down Expand Up @@ -31,8 +31,7 @@
"request-storage": "6.0",
"pick-slips": "0.1",
"search-slips": "0.1",
"automated-patron-blocks": "0.1",
"circulation-bff-requests": "1.0"
"automated-patron-blocks": "0.1"
},
"permissionSets": [
{
Expand Down Expand Up @@ -134,6 +133,8 @@
"circulation-storage.staff-slips.collection.get",
"circulation.pick-slips.get",
"circulation.search-slips.get",
"circulation-bff.pick-slips.collection.get",
"circulation-bff.search-slips.collection.get",
"circulation.print-events-entry.item.post",
"inventory-storage.locations.item.get",
"circulation-bff.requests.search-instances.get",
Expand All @@ -148,6 +149,8 @@
"ui-requests.view",
"circulation.pick-slips.get",
"circulation.search-slips.get",
"circulation-bff.pick-slips.collection.get",
"circulation-bff.search-slips.collection.get",
"circulation.requests.item.put",
"circulation.requests.allowed-service-points.get",
"circulation-bff.requests.allowed-service-points.get",
Expand Down
1 change: 1 addition & 0 deletions src/ChooseRequestTypeDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ class ChooseRequestTypeDialog extends React.Component {
{isLoading ?
<Loading data-testid="loading" /> :
<Select
data-testid="requestType"
label={<FormattedMessage id="ui-requests.moveRequest.chooseRequestMessage" />}
name="requestType"
onChange={this.selectRequestType}
Expand Down
36 changes: 36 additions & 0 deletions src/ChooseRequestTypeDialog.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
render,
screen,
fireEvent,
} from '@folio/jest-config-stripes/testing-library/react';

import { Button } from '@folio/stripes/components';
Expand All @@ -23,9 +24,12 @@ jest.mock('./utils', () => ({

const labelIds = {
chooseRequestType: 'ui-requests.moveRequest.chooseRequestType',
confirmButtonLabel: 'ui-requests.moveRequest.confirm',
requestTypeError: 'ui-requests.moveRequest.error.itemLevelRequest',
};
const testIds = {
loading: 'loading',
requestType: 'requestType',
};

describe('ChooseRequestTypeDialog', () => {
Expand Down Expand Up @@ -85,6 +89,38 @@ describe('ChooseRequestTypeDialog', () => {
it('should not render Loading component', () => {
expect(screen.queryByTestId(testIds.loading)).not.toBeInTheDocument();
});

it('should handle confirmation after changing request type', () => {
const requestType = screen.getByTestId(testIds.requestType);
const confirmButton = screen.getByText(labelIds.confirmButtonLabel);
const event = {
target: {
value: '',
},
};

fireEvent.change(requestType, event);
fireEvent.click(confirmButton);

expect(mockOnConfirm).toHaveBeenCalledWith(event.target.value);
});
});

describe('When request type is not provided', () => {
const props = {
...defaultTestProps,
requestTypes: [],
};

beforeEach(() => {
render(<ChooseRequestTypeDialog {...props} />);
});

it('should render request type error', () => {
const requestTypeError = screen.getByText(labelIds.requestTypeError);

expect(requestTypeError).toBeInTheDocument();
});
});

describe('when isLoading is true', () => {
Expand Down
Loading

0 comments on commit 3b483dc

Please sign in to comment.