Skip to content
Snippets Groups Projects
Commit e7b4d874 authored by Mihail Hagiu's avatar Mihail Hagiu
Browse files

fix(ReviewersCanSeeEditorialComments): Added test for new case

parent 29c7d9c1
No related branches found
No related tags found
1 merge request!100Hin 1043
......@@ -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 = [
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment