Skip to content

Commit

Permalink
UIU-2964 - refine and clean
Browse files Browse the repository at this point in the history
  • Loading branch information
Terala-Priyanka committed Nov 15, 2023
1 parent 2342d23 commit f515ba0
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 32 deletions.
4 changes: 0 additions & 4 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,3 @@ export const USER_TYPES = {
SYSTEM: 'system',
DCB: 'dcb',
};

export const DCB_USER = {
lastName: 'DcbSystem'
};
8 changes: 0 additions & 8 deletions src/utils.js

This file was deleted.

14 changes: 0 additions & 14 deletions src/utils.test.js

This file was deleted.

4 changes: 2 additions & 2 deletions src/views/LoanDetails/LoanDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ import {
getRenewalPatronBlocksFromPatronBlocks,
accountsMatchStatus,
checkUserActive,
isDcbUser,
} from '../../components/util';
import { itemStatuses, loanActions, refundClaimReturned } from '../../constants';
import { isAVirtualPatron } from '../../utils';
import {
withRenew,
withDeclareLost,
Expand Down Expand Up @@ -488,7 +488,7 @@ class LoanDetails extends React.Component {
const patronBlocksForModal = getRenewalPatronBlocksFromPatronBlocks(patronBlocks);
const isUserActive = user ? checkUserActive(user) : false;
const borrower = user ? getFullName(user) : <FormattedMessage id="ui-users.user.unknown" />;
const isVirtualPatron = isAVirtualPatron(user?.personal?.lastName);
const isVirtualPatron = isDcbUser(user);

return (
<div data-test-loan-actions-history>
Expand Down
5 changes: 1 addition & 4 deletions src/views/LoanDetails/LoanDetails.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import okapiOpenLoan from 'fixtures/openLoan';
import okapiCurrentUser from 'fixtures/okapiCurrentUser';
import renderWithRouter from 'helpers/renderWithRouter';
import LoanDetails from './LoanDetails';
import { DCB_USER } from '../../constants';

jest.useFakeTimers('legacy');
jest.mock('react-intl', () => ({
Expand Down Expand Up @@ -498,9 +497,7 @@ describe('LoanDetails', () => {
...propsData,
user: {
...propsData.user,
personal: {
lastName: DCB_USER.lastName
}
type: 'dcb',
}
};

Expand Down

0 comments on commit f515ba0

Please sign in to comment.