Skip to content
Snippets Groups Projects
Commit 9dfde037 authored by Tania Fecheta's avatar Tania Fecheta
Browse files

test(authsome-helpers): add tests to check if reviewers see other reports

parent ded6dc77
No related branches found
No related tags found
3 merge requests!176Sprint 24,!171Sprint 24,!166Hin 1051 reviewers see all reports
......@@ -116,7 +116,7 @@ describe('Authsome Helpers', () => {
const { files = {} } = result
expect(files.coverLetter).toBeFalsy()
})
it('reviewer should not see private comments', () => {
it('reviewer should not see private comments on the last version of the manuscript', () => {
const { fragment } = testFixtures.fragments
fragment.recommendations = [
{
......@@ -143,6 +143,48 @@ describe('Authsome Helpers', () => {
expect(recommendations[0].comments[0].public).toEqual(true)
})
it('reviewer should see other reviewers recommendations on previous version if he submitted a review on that fragment', () => {
const { fragment } = testFixtures.fragments
const { answerReviewer } = testFixtures.users
const result = ah.stripeFragmentByRole({
fragment,
role: 'reviewer',
isLast: false,
user: answerReviewer,
})
const { recommendations } = result
expect(recommendations).toHaveLength(7)
})
it('reviewer should not see other reviewers recommendations on latest fragment', () => {
const { fragment } = testFixtures.fragments
const { answerReviewer } = testFixtures.users
const result = ah.stripeFragmentByRole({
fragment,
role: 'reviewer',
isLast: true,
user: answerReviewer,
})
const { recommendations } = result
expect(recommendations).toHaveLength(6)
})
it('reviewer should not see any reviewer recommendation on previous version if he did not submit a review on that fragment', () => {
const { fragment } = testFixtures.fragments
const { inactiveReviewer } = testFixtures.users
const result = ah.stripeFragmentByRole({
fragment,
role: 'reviewer',
isLast: false,
user: inactiveReviewer,
})
const { recommendations } = result
expect(recommendations).toHaveLength(0)
})
it('author should not see recommendations if a decision has not been made', () => {
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