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

test(fragmentRecommendation/post): add test for case HE makes another...

test(fragmentRecommendation/post): add test for case HE makes another recommendation after eic decid
parent 87542699
No related branches found
No related tags found
3 merge requests!176Sprint 24,!171Sprint 24,!157fix(fragmentRecommendation): allow HE to make another recommendation on the same…
...@@ -592,6 +592,31 @@ describe('Post fragments recommendations route handler', () => { ...@@ -592,6 +592,31 @@ describe('Post fragments recommendations route handler', () => {
expect(data.userId).toEqual(noRecommendationHE.id) expect(data.userId).toEqual(noRecommendationHE.id)
}) })
it('should return an error when creating another recommendation as a HE on the same version after EiC made decision to publish', async () => {
const { handlingEditor } = testFixtures.users
const { collection } = testFixtures.collections
const { fragment } = testFixtures.fragments
body.recommendation = 'publish'
body.recommendationType = 'editorRecommendation'
const res = await requests.sendRequest({
body,
userId: handlingEditor.id,
models,
route,
path,
params: {
collectionId: collection.id,
fragmentId: fragment.id,
},
})
expect(res.statusCode).toBe(400)
const data = JSON.parse(res._getData())
expect(data.error).toEqual(
'Cannot make another recommendation on this version.',
)
})
it('should return an error when an EiC makes a decision on an older version of a manuscript', async () => { it('should return an error when an EiC makes a decision on an older version of a manuscript', async () => {
const { editorInChief } = testFixtures.users const { editorInChief } = testFixtures.users
const { twoVersionsCollection } = testFixtures.collections const { twoVersionsCollection } = testFixtures.collections
......
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