diff --git a/packages/xpub-faraday/config/authsome-helpers.js b/packages/xpub-faraday/config/authsome-helpers.js index b4d065ef716ab407e55f48d192dac4dbf3f32cd3..56f1495a32349c9bafda65a920dab6b9f5560305 100644 --- a/packages/xpub-faraday/config/authsome-helpers.js +++ b/packages/xpub-faraday/config/authsome-helpers.js @@ -142,7 +142,7 @@ const stripeCollectionByRole = (coll = {}, role = '') => { const { handlingEditor } = coll if (!authorAllowedStatuses.includes(coll.status)) { - coll = { + return { ...coll, handlingEditor: handlingEditor && handlingEditor.isAccepted && { diff --git a/packages/xpub-faraday/tests/authsome-helpers.test.js b/packages/xpub-faraday/tests/authsome-helpers.test.js index 97d6798bb2685683783f7aea2c49c1b9d99ee07f..cdc942b01bdb01d6b6965c6b7b0c5983d9a962db 100644 --- a/packages/xpub-faraday/tests/authsome-helpers.test.js +++ b/packages/xpub-faraday/tests/authsome-helpers.test.js @@ -136,7 +136,7 @@ describe('Authsome Helpers', () => { }) expect(recommendations).toHaveLength(0) }) - it('stripeFragment - author should see reviews only if recommendation has been made', () => { + it('stripeFragment - author should see reviews only if recommendation has been made and only public ones', () => { const { fragment } = testFixtures.fragments fragment.recommendations = [ { @@ -157,7 +157,7 @@ describe('Authsome Helpers', () => { role: 'author', status: 'revisionRequested', }) - const privateComments = get(result, 'recommendations[0].comments') - expect(privateComments).toHaveLength(1) + const publicComments = get(result, 'recommendations[0].comments') + expect(publicComments).toHaveLength(1) }) })