From e99611536beca11fd896473e007e60c1966c206c Mon Sep 17 00:00:00 2001 From: Artem Blazhko Date: Fri, 22 Nov 2024 12:31:45 +0200 Subject: [PATCH] Hide proxy functionality for ECS with mod-tlr enabled (#1231) --- CHANGELOG.md | 2 +- src/RequestForm.js | 21 +++++++++++++---- src/RequestForm.test.js | 1 + src/RequestFormContainer.js | 3 +++ src/UserDetail.js | 5 +++- src/UserDetail.test.js | 2 ++ src/UserForm.js | 10 +++++--- src/UserForm.test.js | 2 ++ src/ViewRequest.js | 10 ++++++++ .../RequesterInformation.js | 3 +++ .../RequesterInformation.test.js | 2 ++ src/constants.js | 9 ++++++-- .../components/RequestForm/RequestForm.js | 6 +++-- .../RequestForm/RequestForm.test.js | 8 ++++--- src/deprecated/utils.js | 8 +++++++ src/deprecated/utils.test.js | 23 ++++++++++++++++++- src/routes/RequestsRoute.js | 23 ++++++++++++++----- src/routes/RequestsRoute.test.js | 1 + src/utils.js | 8 +++++-- src/utils.test.js | 9 +++++++- 20 files changed, 129 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c7d960ade..4358a1d04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,8 +18,8 @@ * Add `mod-settings.entries.collection.get` permission. Refs UIREQ-1177. * *BREAKING* Migrate to new `mod-circulation-bff` endpoints. Refs UIREQ-1134. * Implement feature toggle for ECS and not ECS envs. Refs UIREQ-1171. - * Update permission checks of ui-users. Refs UIREQ-1187. +* Hide proxy functionality for ECS with mod-tlr enabled. Refs UIREQ-1185. ## [10.0.1] (https://github.com/folio-org/ui-requests/tree/v10.0.1) (2024-11-13) [Full Changelog](https://github.com/folio-org/ui-requests/compare/v10.0.0...v10.0.1) diff --git a/src/RequestForm.js b/src/RequestForm.js index aacc5e435..14fd05430 100644 --- a/src/RequestForm.js +++ b/src/RequestForm.js @@ -78,6 +78,7 @@ import { isFormEditing, resetFieldState, getRequester, + isProxyFunctionalityAvailable, } from './utils'; import css from './requests.css'; @@ -159,6 +160,7 @@ class RequestForm extends React.Component { onSetSelectedInstance: PropTypes.func.isRequired, onSetBlocked: PropTypes.func.isRequired, onSetIsPatronBlocksOverridden: PropTypes.func.isRequired, + isEcsTlrSettingEnabled: PropTypes.bool.isRequired, }; static defaultProps = { @@ -472,7 +474,9 @@ class RequestForm extends React.Component { } async hasProxies(user) { - if (!user) { + const { isEcsTlrSettingEnabled } = this.props; + + if (!user || !isProxyFunctionalityAvailable(isEcsTlrSettingEnabled)) { this.setState({ isAwaitingForProxySelection: false }); return null; @@ -509,6 +513,7 @@ class RequestForm extends React.Component { onSetIsPatronBlocksOverridden, onSetSelectedUser, onSetBlocked, + isEcsTlrSettingEnabled, } = this.props; this.setState({ @@ -535,7 +540,9 @@ class RequestForm extends React.Component { return findResource(RESOURCE_TYPES.USER, value, fieldName) .then((result) => { - this.setState({ isAwaitingForProxySelection: true }); + if (isProxyFunctionalityAvailable(isEcsTlrSettingEnabled)) { + this.setState({ isAwaitingForProxySelection: true }); + } if (result.totalRecords === 1) { const blocks = onGetPatronManualBlocks(parentResources); @@ -759,6 +766,7 @@ class RequestForm extends React.Component { form, onSetSelectedItem, selectedUser, + isEcsTlrSettingEnabled, } = this.props; const { proxy } = this.state; @@ -815,7 +823,7 @@ class RequestForm extends React.Component { }) .then(item => { if (item && selectedUser?.id) { - const requester = getRequester(proxy, selectedUser); + const requester = getRequester(proxy, selectedUser, isEcsTlrSettingEnabled); this.findRequestTypes(item.id, requester.id, ID_TYPE_MAP.ITEM_ID); } @@ -848,6 +856,7 @@ class RequestForm extends React.Component { form, onSetSelectedInstance, selectedUser, + isEcsTlrSettingEnabled, } = this.props; const { proxy } = this.state; @@ -897,7 +906,7 @@ class RequestForm extends React.Component { }) .then(instance => { if (instance && selectedUser?.id) { - const requester = getRequester(proxy, selectedUser); + const requester = getRequester(proxy, selectedUser, isEcsTlrSettingEnabled); this.findRequestTypes(instance.id, requester.id, ID_TYPE_MAP.INSTANCE_ID); } @@ -1111,6 +1120,7 @@ class RequestForm extends React.Component { onSetSelectedItem, onSetSelectedInstance, metadataDisplay, + isEcsTlrSettingEnabled, } = this.props; const { @@ -1139,7 +1149,7 @@ class RequestForm extends React.Component { const automatedPatronBlocks = onGetAutomatedPatronBlocks(parentResources); const isEditForm = isFormEditing(request); const selectedProxy = getProxy(request, proxy); - const requester = getRequester(selectedProxy, selectedUser); + const requester = getRequester(selectedProxy, selectedUser, isEcsTlrSettingEnabled); let deliveryLocations; let deliveryLocationsDetail = []; let addressDetail; @@ -1331,6 +1341,7 @@ class RequestForm extends React.Component { handleCloseProxy={this.handleCloseProxy} findUser={this.findUser} triggerUserBarcodeValidation={this.triggerUserBarcodeValidation} + isEcsTlrSettingEnabled={isEcsTlrSettingEnabled} /> diff --git a/src/RequestForm.test.js b/src/RequestForm.test.js index ace72ad8f..1d57235a1 100644 --- a/src/RequestForm.test.js +++ b/src/RequestForm.test.js @@ -76,6 +76,7 @@ jest.mock('./utils', () => ({ isFormEditing: jest.fn(), getFulfillmentPreference: jest.fn(), getRequester: jest.fn((proxy, selectedUser) => selectedUser), + isProxyFunctionalityAvailable: jest.fn(() => true), })); jest.mock('./components/FulfilmentPreference', () => jest.fn(({ changeDeliveryAddress, diff --git a/src/RequestFormContainer.js b/src/RequestFormContainer.js index c28107383..bb9ebce1e 100644 --- a/src/RequestFormContainer.js +++ b/src/RequestFormContainer.js @@ -27,6 +27,7 @@ const RequestFormContainer = ({ parentResources, request, onSubmit, + isEcsTlrSettingEnabled, ...rest }) => { const { @@ -182,6 +183,7 @@ const RequestFormContainer = ({ onSetSelectedInstance={setInstance} onSetIsPatronBlocksOverridden={setStateIsPatronBlocksOverridden} onSubmit={handleSubmit} + isEcsTlrSettingEnabled={isEcsTlrSettingEnabled} /> ); }; @@ -190,6 +192,7 @@ RequestFormContainer.propTypes = { request: PropTypes.object, parentResources: PropTypes.object, onSubmit: PropTypes.func.isRequired, + isEcsTlrSettingEnabled: PropTypes.bool.isRequired, }; export default RequestFormContainer; diff --git a/src/UserDetail.js b/src/UserDetail.js index 40f327bbe..2edf35365 100644 --- a/src/UserDetail.js +++ b/src/UserDetail.js @@ -13,6 +13,7 @@ import { getFullName, userHighlightBox, getPatronGroup, + isProxyFunctionalityAvailable, } from './utils'; class UserDetail extends React.Component { @@ -23,6 +24,7 @@ class UserDetail extends React.Component { proxy: PropTypes.object, request: PropTypes.object.isRequired, user: PropTypes.object.isRequired, + isEcsTlrSettingEnabled: PropTypes.bool.isRequired, selectedDelivery: PropTypes.bool, }; @@ -41,6 +43,7 @@ class UserDetail extends React.Component { deliveryAddress, pickupServicePoint, selectedDelivery, + isEcsTlrSettingEnabled, } = this.props; const id = user?.id ?? request.requesterId; @@ -51,7 +54,7 @@ class UserDetail extends React.Component { let proxyName; let proxyBarcode; let proxyId; - if (proxy) { + if (isProxyFunctionalityAvailable(isEcsTlrSettingEnabled) && proxy) { proxyName = getFullName(proxy); proxyBarcode = proxy?.barcode || ; proxyId = proxy.id || request.proxyUserId; diff --git a/src/UserDetail.test.js b/src/UserDetail.test.js index 7f1e01032..cf5eaccb2 100644 --- a/src/UserDetail.test.js +++ b/src/UserDetail.test.js @@ -33,6 +33,7 @@ const basicProps = { lastName: 'userLastName', }, selectedDelivery: true, + isEcsTlrSettingEnabled: false, }; const labelIds = { proxy: 'ui-requests.requester.proxy', @@ -54,6 +55,7 @@ jest.mock('./utils', () => ({ getPatronGroup: jest.fn(() => ({ group: 'testPatronGroup', })), + isProxyFunctionalityAvailable: jest.fn(() => true), })); describe('UserDetail', () => { diff --git a/src/UserForm.js b/src/UserForm.js index b17047bac..2fc9098cc 100644 --- a/src/UserForm.js +++ b/src/UserForm.js @@ -14,6 +14,7 @@ import { ProxyManager } from '@folio/stripes/smart-components'; import { getFullName, userHighlightBox, + isProxyFunctionalityAvailable, } from './utils'; class UserForm extends React.Component { @@ -24,6 +25,7 @@ class UserForm extends React.Component { proxy: PropTypes.object, stripes: PropTypes.object.isRequired, user: PropTypes.object.isRequired, + isEcsTlrSettingEnabled: PropTypes.bool.isRequired, request: PropTypes.object, }; @@ -43,17 +45,19 @@ class UserForm extends React.Component { proxy, patronGroup, request, + isEcsTlrSettingEnabled, } = this.props; - + const isProxyAvailable = isProxyFunctionalityAvailable(isEcsTlrSettingEnabled); const id = user?.id ?? request.requesterId; const name = getFullName(user); const barcode = user.barcode; const isEditable = !!request; + const isProxyManagerAvailable = isProxyAvailable && !isEditable; let proxyName; let proxyBarcode; let proxyId; - if (proxy) { + if (isProxyAvailable && proxy) { proxyName = getFullName(proxy); proxyBarcode = proxy?.barcode || '-'; proxyId = proxy.id; @@ -78,7 +82,7 @@ class UserForm extends React.Component { {proxySection} - { !isEditable && + {isProxyManagerAvailable && ({ {barcode} )), + isProxyFunctionalityAvailable: jest.fn(() => true), })); describe('UserForm', () => { diff --git a/src/ViewRequest.js b/src/ViewRequest.js index 86324a872..71b422397 100644 --- a/src/ViewRequest.js +++ b/src/ViewRequest.js @@ -67,6 +67,7 @@ import { isVirtualPatron, getRequestErrorMessage, isMultiDataTenant, + isProxyFunctionalityAvailable, } from './utils'; import urls from './routes/urls'; @@ -230,6 +231,7 @@ class ViewRequest extends React.Component { } update(record) { + const { isEcsTlrSettingEnabled } = this.props; const requestFromProps = this.getRequestFromProps() || {}; const updatedRecord = { ...requestFromProps, @@ -251,6 +253,11 @@ class ViewRequest extends React.Component { delete updatedRecord.numberOfReorderableRequests; delete updatedRecord.holdShelfExpirationTime; + if (!isProxyFunctionalityAvailable(isEcsTlrSettingEnabled)) { + delete updatedRecord.proxy; + delete updatedRecord.proxyUserId; + } + this.props.mutator.selectedRequest.PUT(updatedRecord).then(() => { this.props.onCloseEdit(); this.callout.current.sendCallout({ @@ -381,6 +388,7 @@ class ViewRequest extends React.Component { findResource, patronGroups, parentMutator, + isEcsTlrSettingEnabled, } = this.props; const { titleLevelRequestsFeatureEnabled, @@ -425,6 +433,7 @@ class ViewRequest extends React.Component { parentMutator={parentMutator} findResource={findResource} isTlrEnabledOnEditPage={titleLevelRequestsFeatureEnabled} + isEcsTlrSettingEnabled={isEcsTlrSettingEnabled} /> ) } @@ -821,6 +830,7 @@ class ViewRequest extends React.Component { selectedDelivery={selectedDelivery} deliveryAddress={deliveryAddressDetail} pickupServicePoint={getPickupServicePointName} + isEcsTlrSettingEnabled={isEcsTlrSettingEnabled} /> } { diff --git a/src/components/RequesterInformation/RequesterInformation.test.js b/src/components/RequesterInformation/RequesterInformation.test.js index b3758b70d..3dde11475 100644 --- a/src/components/RequesterInformation/RequesterInformation.test.js +++ b/src/components/RequesterInformation/RequesterInformation.test.js @@ -65,6 +65,7 @@ const basicProps = { }, isLoading: false, submitting: false, + isEcsTlrSettingEnabled: false, }; const labelIds = { selectUserError: 'ui-requests.errors.selectUser', @@ -246,6 +247,7 @@ describe('RequesterInformation', () => { proxy: basicProps.selectedProxy, onSelectProxy: basicProps.onSelectProxy, onCloseProxy: basicProps.handleCloseProxy, + isEcsTlrSettingEnabled: basicProps.isEcsTlrSettingEnabled, }; render( diff --git a/src/constants.js b/src/constants.js index a4d7c6ae8..225b174b8 100644 --- a/src/constants.js +++ b/src/constants.js @@ -174,6 +174,11 @@ export const PRINT_DETAILS_COLUMNS = { PRINTED: 'printDetails.lastPrintedDetails', }; +export const PROXY_COLUMNS = { + NAME: 'proxy.name', + BARCODE: 'proxy.barcode', +}; + export const reportHeaders = [ 'requestType', 'status', @@ -203,8 +208,8 @@ export const reportHeaders = [ 'fulfillmentPreference', 'pickupServicePoint.name', 'deliveryAddress', - 'proxy.name', - 'proxy.barcode', + PROXY_COLUMNS.NAME, + PROXY_COLUMNS.BARCODE, 'tags.tagList', 'patronComments', PRINT_DETAILS_COLUMNS.COPIES, diff --git a/src/deprecated/components/RequestForm/RequestForm.js b/src/deprecated/components/RequestForm/RequestForm.js index ba0387d39..8094ebfc1 100644 --- a/src/deprecated/components/RequestForm/RequestForm.js +++ b/src/deprecated/components/RequestForm/RequestForm.js @@ -77,9 +77,11 @@ import { isSubmittingButtonDisabled, isFormEditing, resetFieldState, - getRequester, } from '../../../utils'; -import { getTlrSettings } from '../../utils'; +import { + getTlrSettings, + getRequester, +} from '../../utils'; import css from './RequestForm.css'; diff --git a/src/deprecated/components/RequestForm/RequestForm.test.js b/src/deprecated/components/RequestForm/RequestForm.test.js index 25cad7315..360ce3208 100644 --- a/src/deprecated/components/RequestForm/RequestForm.test.js +++ b/src/deprecated/components/RequestForm/RequestForm.test.js @@ -35,9 +35,11 @@ import { isFormEditing, getFulfillmentPreference, resetFieldState, - getRequester, } from '../../../utils'; -import { getTlrSettings } from '../../utils'; +import { + getTlrSettings, + getRequester, +} from '../../utils'; const testIds = { tlrCheckbox: 'tlrCheckbox', @@ -69,12 +71,12 @@ jest.mock('../../../utils', () => ({ getDefaultRequestPreferences: jest.fn(), isFormEditing: jest.fn(), getFulfillmentPreference: jest.fn(), - getRequester: jest.fn((proxy, selectedUser) => selectedUser), })); jest.mock('../../utils', () => ({ getTlrSettings: jest.fn(() => ({ titleLevelRequestsFeatureEnabled: true, })), + getRequester: jest.fn((proxy, selectedUser) => selectedUser), })); jest.mock('../../../components/FulfilmentPreference', () => jest.fn(({ changeDeliveryAddress, diff --git a/src/deprecated/utils.js b/src/deprecated/utils.js index c7be34864..01c96d717 100644 --- a/src/deprecated/utils.js +++ b/src/deprecated/utils.js @@ -5,3 +5,11 @@ export const getTlrSettings = (settings) => { return {}; } }; + +export const getRequester = (proxy, selectedUser) => { + if (proxy && proxy.id !== selectedUser?.id) { + return proxy; + } + + return selectedUser; +}; diff --git a/src/deprecated/utils.test.js b/src/deprecated/utils.test.js index acbb7e3b8..158f09fb6 100644 --- a/src/deprecated/utils.test.js +++ b/src/deprecated/utils.test.js @@ -1,4 +1,7 @@ -import { getTlrSettings } from './utils'; +import { + getTlrSettings, + getRequester, +} from './utils'; describe('utils', () => { describe('getTlrSettings', () => { @@ -15,4 +18,22 @@ describe('utils', () => { expect(getTlrSettings()).toEqual({}); }); }); + + describe('getRequester', () => { + const selectedUser = { + id: 'selectedUserId', + }; + + it('should return proxy user', () => { + const proxy = { + id: 'proxyId', + }; + + expect(getRequester(proxy, selectedUser)).toEqual(proxy); + }); + + it('should return selected user', () => { + expect(getRequester(null, selectedUser)).toEqual(selectedUser); + }); + }); }); diff --git a/src/routes/RequestsRoute.js b/src/routes/RequestsRoute.js index 59e420600..a62c21f45 100644 --- a/src/routes/RequestsRoute.js +++ b/src/routes/RequestsRoute.js @@ -72,6 +72,7 @@ import { PRINT_DETAILS_COLUMNS, RESOURCE_TYPES, requestFilterTypes, + PROXY_COLUMNS, } from '../constants'; import { buildUrl, @@ -87,6 +88,7 @@ import { selectedRowsNonPrintable, getNextSelectedRowsState, isMultiDataTenant, + isProxyFunctionalityAvailable, } from '../utils'; import packageInfo from '../../package'; import CheckboxColumn from '../components/CheckboxColumn'; @@ -247,6 +249,7 @@ export const getListFormatter = ( onBeforeGetContentForSinglePrintButton, onBeforePrintForSinglePrintButton, onAfterPrintForSinglePrintButton, + isProxyAvailable, } ) => ({ 'select': rq => ( @@ -257,7 +260,7 @@ export const getListFormatter = ( />), 'itemBarcode': rq => (rq.item ? rq.item.barcode : DEFAULT_FORMATTER_VALUE), 'position': rq => (rq.position || DEFAULT_FORMATTER_VALUE), - 'proxy': rq => (rq.proxy ? getFullName(rq.proxy) : DEFAULT_FORMATTER_VALUE), + ...(isProxyAvailable ? { 'proxy': rq => (rq.proxy ? getFullName(rq.proxy) : DEFAULT_FORMATTER_VALUE) } : {}), 'requestDate': rq => ( @@ -888,6 +891,8 @@ class RequestsRoute extends React.Component { // Export function for the CSV search report action async exportData() { + const { isEcsTlrSettingEnabled } = this.state; + this.setState({ csvReportPending: true }); // Build a custom query for the CSV record export, which has to include @@ -910,9 +915,12 @@ class RequestsRoute extends React.Component { this.columnHeadersMap = this.state.isViewPrintDetailsEnabled ? this.columnHeadersMap : getFilteredColumnHeadersMap(this.columnHeadersMap); + const finalColumnHeadersMap = isProxyFunctionalityAvailable(isEcsTlrSettingEnabled) ? + this.columnHeadersMap : + this.columnHeadersMap.filter(({ value }) => (value !== PROXY_COLUMNS.BARCODE && value !== PROXY_COLUMNS.NAME)); exportCsv(recordsToCSV, { - onlyFields: this.columnHeadersMap, + onlyFields: finalColumnHeadersMap, excludeFields: ['id'], }); @@ -953,6 +961,7 @@ class RequestsRoute extends React.Component { }; buildRecords(recordsLoaded) { + const { isEcsTlrSettingEnabled } = this.state; const result = JSON.parse(JSON.stringify(recordsLoaded)); // Do not mutate the actual resource const { formatDate, formatTime } = this.props.intl; @@ -984,7 +993,7 @@ class RequestsRoute extends React.Component { const { dueDate } = record.loan; record.loan.dueDate = `${formatDate(dueDate)}, ${formatTime(dueDate)}`; } - if (record.proxy) { + if (isProxyFunctionalityAvailable(isEcsTlrSettingEnabled) && record.proxy) { record.proxy.name = getFullNameForCsvRecords(record.proxy); } if (record.deliveryAddress) { @@ -1446,6 +1455,7 @@ class RequestsRoute extends React.Component { isEcsTlrSettingReceived, isEcsTlrSettingEnabled, } = this.state; + const isProxyAvailable = isProxyFunctionalityAvailable(isEcsTlrSettingEnabled); const isPrintHoldRequestsEnabled = getPrintHoldRequestsEnabled(resources.printHoldRequests); const { name: servicePointName } = this.getCurrentServicePointInfo(); const pickSlips = get(resources, 'pickSlips.records', []); @@ -1481,7 +1491,7 @@ class RequestsRoute extends React.Component { requester: , requesterBarcode: , singlePrint: , - proxy: , + ...(isProxyAvailable ? { proxy: } : {}), ...(isViewPrintDetailsEnabled && { copies: , printed: , @@ -1516,6 +1526,7 @@ class RequestsRoute extends React.Component { onBeforeGetContentForSinglePrintButton: this.onBeforeGetContentForSinglePrintButton, onBeforePrintForSinglePrintButton: this.savePrintEventDetails, onAfterPrintForSinglePrintButton: this.onAfterPrintForPrintButton, + isProxyAvailable, } ); @@ -1668,7 +1679,7 @@ class RequestsRoute extends React.Component { 'position', 'requester', 'requesterBarcode', - 'proxy', + ...(isProxyAvailable ? ['proxy'] : []), ], }; const pageTitle = this.getPageTitle(); @@ -1752,7 +1763,7 @@ class RequestsRoute extends React.Component { resultIsSelected={this.resultIsSelected} onFilterChange={this.handleFilterChange} sortableColumns={['requestDate', 'title', 'year', 'itemBarcode', 'callNumber', 'type', 'requestStatus', - 'position', 'servicePoint', 'requester', 'requesterBarcode', 'proxy', 'copies', 'printed']} + 'position', 'servicePoint', 'requester', 'requesterBarcode', ...(isProxyAvailable ? ['proxy'] : []), 'copies', 'printed']} pageAmount={100} pagingType={MCLPagingTypes.PREV_NEXT} /> diff --git a/src/routes/RequestsRoute.test.js b/src/routes/RequestsRoute.test.js index 7ef69477e..d18c1a8df 100644 --- a/src/routes/RequestsRoute.test.js +++ b/src/routes/RequestsRoute.test.js @@ -1293,6 +1293,7 @@ describe('RequestsRoute', () => { toggleRowSelection: toggleRowSelectionMock, onBeforeGetContentForSinglePrintButton: onBeforeGetContentForSinglePrintButtonMock, onBeforePrintForSinglePrintButton: onBeforePrintForSinglePrintButtonMock, + isProxyAvailable: true, } ); const requestWithData = { diff --git a/src/utils.js b/src/utils.js index cdaf3962c..e511bbfa1 100644 --- a/src/utils.js +++ b/src/utils.js @@ -521,8 +521,12 @@ export const isMultiDataTenant = (stripes) => { return stripes.hasInterface('consortia') && stripes.hasInterface('ecs-tlr'); }; -export const getRequester = (proxy, selectedUser) => { - if (proxy && proxy.id !== selectedUser?.id) { +export const isProxyFunctionalityAvailable = (isEcsTlrSettingEnabled) => { + return !isEcsTlrSettingEnabled; +}; + +export const getRequester = (proxy, selectedUser, isEcsTlrSettingEnabled) => { + if (isProxyFunctionalityAvailable(isEcsTlrSettingEnabled) && proxy && proxy.id !== selectedUser?.id) { return proxy; } diff --git a/src/utils.test.js b/src/utils.test.js index c46e65fb9..54a1dff3b 100644 --- a/src/utils.test.js +++ b/src/utils.test.js @@ -37,6 +37,7 @@ import { isMultiDataTenant, getRequester, getFullName, + isProxyFunctionalityAvailable, } from './utils'; import { @@ -1138,7 +1139,13 @@ describe('getRequester', () => { }); it('should return selected user', () => { - expect(getRequester(null, selectedUser)).toEqual(selectedUser); + expect(getRequester(null, selectedUser, false)).toEqual(selectedUser); + }); +}); + +describe('isProxyFunctionalityAvailable', () => { + it('should return proxy availability', () => { + expect(isProxyFunctionalityAvailable(true)).toBe(false); }); });