diff --git a/src/views/LoanDetails/LoanProxyDetails.js b/src/views/LoanDetails/LoanProxyDetails.js index 38a3ed854..c8970cb55 100644 --- a/src/views/LoanDetails/LoanProxyDetails.js +++ b/src/views/LoanDetails/LoanProxyDetails.js @@ -22,6 +22,7 @@ class LoanProxyDetails extends React.Component { resources: PropTypes.shape({ proxy: PropTypes.shape({ records: PropTypes.arrayOf(PropTypes.object), + hasLoaded: PropTypes.bool, }), }), mutator: PropTypes.shape({ @@ -45,7 +46,6 @@ class LoanProxyDetails extends React.Component { getUserFullName() { const proxy = (this.props.resources.proxy || {}).records || []; - console.log('proxy.length: ', proxy.length); if (proxy.length === 1 && proxy[0].id === this.props.id) { return {getFullName(proxy[0])}; } diff --git a/src/views/LoanDetails/LoanProxyDetails.test.js b/src/views/LoanDetails/LoanProxyDetails.test.js index bdc5b35c8..dc6ec6180 100644 --- a/src/views/LoanDetails/LoanProxyDetails.test.js +++ b/src/views/LoanDetails/LoanProxyDetails.test.js @@ -21,7 +21,8 @@ const props = (propID, proxyID) => { id: propID, resources: { proxy: { - records: [{ id: proxyID }] + records: [{ id: proxyID }], + hasLoaded: true, } }, mutator: { @@ -57,11 +58,15 @@ describe('Render LoanProxyDetails component', () => { const newprops = { id: 'test', resources: { - proxy: null + proxy: { + records: null, + hasLoaded: true, + }, }, mutator: { proxy: { GET: jest.fn().mockRejectedValueOnce(), + reset: jest.fn(), }, }, showErrorCallout: showErrorMock,