Skip to content

Commit

Permalink
Cover RequesterInformation by jest/RTL tests
Browse files Browse the repository at this point in the history
  • Loading branch information
artem-blazhko committed Sep 7, 2023
1 parent 25bc0c2 commit cefd89e
Show file tree
Hide file tree
Showing 5 changed files with 688 additions and 16 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
* Correctly escape CQL special characters in tag API queries. Refs UIREQ-918.
* Add new pickup service point error. Refs UIREQ-981.
* Move request popup show available Request Types. Refs UIREQ-1005.
* Cover RequesterInformation by jest/RTL tests. Refs UIREQ-952.

## [8.0.2](https://github.com/folio-org/ui-requests/tree/v8.0.2) (2023-03-29)
[Full Changelog](https://github.com/folio-org/ui-requests/compare/v8.0.1...v8.0.2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,8 @@ describe('InstanceInformation', () => {

it('should trigger "findInstance" with correct argument', () => {
const hrid = 'hrid';
const searchButton = screen.getByText('Search Instance');
const searchButtonLabel = 'Search';
const searchButton = screen.getByText(searchButtonLabel);

fireEvent.click(searchButton);

Expand Down
7 changes: 4 additions & 3 deletions src/components/RequesterInformation/RequesterInformation.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import {

import css from '../../requests.css';

const VISIBLE_COLUMNS = ['active', 'name', 'patronGroup', 'username', 'barcode'];
const COLUMN_MAPPING = {
export const VISIBLE_COLUMNS = ['active', 'name', 'patronGroup', 'username', 'barcode'];
export const COLUMN_MAPPING = {
name: <FormattedMessage id="ui-requests.requester.name" />,
patronGroup: <FormattedMessage id="ui-requests.requester.patronGroup.group" />,
username: <FormattedMessage id="ui-requests.requester.username" />,
Expand All @@ -42,7 +42,6 @@ class RequesterInformation extends Component {
static propTypes = {
form: PropTypes.object.isRequired,
values: PropTypes.object.isRequired,
selectedUser: PropTypes,
onSetSelectedUser: PropTypes.func.isRequired,
submitting: PropTypes.bool.isRequired,
onSetIsPatronBlocksOverridden: PropTypes.func.isRequired,
Expand All @@ -52,6 +51,7 @@ class RequesterInformation extends Component {
findUser: PropTypes.func.isRequired,
triggerUserBarcodeValidation: PropTypes.func.isRequired,
stripes: stripesShape.isRequired,
selectedUser: PropTypes.object,
isLoading: PropTypes.bool,
request: PropTypes.object,
optionLists: PropTypes.object,
Expand Down Expand Up @@ -229,6 +229,7 @@ class RequesterInformation extends Component {

return (
<Field
data-testid="requesterBarcodeField"
key={key}
name={REQUEST_FORM_FIELD_NAMES.REQUESTER_BARCODE}
validate={this.validate(REQUEST_FORM_FIELD_NAMES.REQUESTER_BARCODE, key)}
Expand Down
Loading

0 comments on commit cefd89e

Please sign in to comment.