diff --git a/src/components/UserDetailSections/ReadingRoomAccess/ReadingRoomAccess.js b/src/components/UserDetailSections/ReadingRoomAccess/ReadingRoomAccess.js index 47da73f83..c66b04004 100644 --- a/src/components/UserDetailSections/ReadingRoomAccess/ReadingRoomAccess.js +++ b/src/components/UserDetailSections/ReadingRoomAccess/ReadingRoomAccess.js @@ -1,6 +1,6 @@ import React, { useState } from 'react'; import PropTypes from 'prop-types'; -import { FormattedMessage } from 'react-intl'; +import { FormattedMessage, useIntl } from 'react-intl'; // import { Link } from 'react-router-dom'; // import { get } from 'lodash'; @@ -47,6 +47,7 @@ const mockedRRAData = [ } ]; const ReadingRoomAccess = (props) => { + const intl = useIntl(); const [filteredRRA, setFilteredRRA] = useState(mockedRRAData); const { accordionId, @@ -126,7 +127,7 @@ const ReadingRoomAccess = (props) => { setFilteredRRA(mockedRRAData)} - placeholder="Search by Reading Room" + placeholder={intl.formatMessage({ id:'ui-users.readingRoom.filter' })} /> } > diff --git a/src/components/UserDetailSections/ReadingRoomAccess/ReadingRoomAccess.test.js b/src/components/UserDetailSections/ReadingRoomAccess/ReadingRoomAccess.test.js index d8e11bf82..2ce821c01 100644 --- a/src/components/UserDetailSections/ReadingRoomAccess/ReadingRoomAccess.test.js +++ b/src/components/UserDetailSections/ReadingRoomAccess/ReadingRoomAccess.test.js @@ -8,6 +8,11 @@ jest.mock('@folio/stripes/components', () => ({ MultiColumnList: jest.fn((props) => (
)), + SearchField: jest.fn((props) => ( + + )), })); const props = { @@ -18,18 +23,23 @@ const props = { }; describe('ReadingRoomAccess', () => { + const alteredProps = { + ...props, + expanded : true, + }; + it('should render and accordion', () => { render(); expect(screen.getByText('ui-users.readingRoom.readingRoomAccess')).toBeDefined(); }); it('should display MultiColumnList', () => { - const alteredProps = { - ...props, - expanded : true, - }; - render(); expect(screen.getByTestId('reading-room-access-mcl')).toBeDefined(); }); + + it('should display search field', () => { + render(); + expect(screen.getByPlaceholderText('ui-users.readingRoom.filter')).toBeDefined(); + }); }); diff --git a/translations/ui-users/en.json b/translations/ui-users/en.json index c3c9f456a..49ae18425 100644 --- a/translations/ui-users/en.json +++ b/translations/ui-users/en.json @@ -365,6 +365,7 @@ "readingRoom.name": "Name", "readingRoom.note": "Note", "readingRoom.lastUpdated": "Last updated", + "readingRoom.filter": "Filter", "crud.closeNewUserDialog": "Close New User Dialog", "crud.editUser": "Edit User",