diff --git a/packages/xpub-faraday/tests/config/authsome-helpers.test.js b/packages/xpub-faraday/tests/config/authsome-helpers.test.js index cd0da494190d265741454051629aa195bc00e675..ced5b1e955140c07bfa275ae1736d1e34edc909a 100644 --- a/packages/xpub-faraday/tests/config/authsome-helpers.test.js +++ b/packages/xpub-faraday/tests/config/authsome-helpers.test.js @@ -115,11 +115,27 @@ describe('Authsome Helpers', () => { const { files = {} } = result expect(files.coverLetter).toBeFalsy() }) - it('reviewer should not see others reviews', () => { + it('reviewer should not see private comments', () => { const { fragment } = testFixtures.fragments + fragment.recommendations = [ + { + comments: [ + { + content: 'private', + public: false, + }, + { + content: 'public', + public: true, + }, + ], + }, + ] const result = ah.stripeFragmentByRole({ fragment, role: 'reviewer' }) const { recommendations } = result - expect(recommendations).toHaveLength(2) + expect(recommendations).toHaveLength(1) + expect(recommendations[0].comments).toHaveLength(1) + expect(recommendations[0].comments[0].public).toEqual(true) }) it('author should not see recommendations if a decision has not been made', () => { @@ -170,6 +186,7 @@ describe('Authsome Helpers', () => { const publicComments = get(result, 'recommendations[0].comments') expect(publicComments).toHaveLength(1) }) + it('HE should not see unsubmitted recommendations', () => { const { fragment } = testFixtures.fragments fragment.recommendations = [