Skip to content
Snippets Groups Projects
Commit acb46ddd authored by Sebastian Mihalache's avatar Sebastian Mihalache :hammer_pick:
Browse files

tests(helper-service): add test for collection without handling editor

parent 243fac44
No related branches found
No related tags found
3 merge requests!160Update staging with master features,!156Develop,!148Hin 1098
...@@ -253,5 +253,22 @@ describe('Fragment helper', () => { ...@@ -253,5 +253,22 @@ describe('Fragment helper', () => {
expect(fragmentUsers.length).toBeGreaterThan(0) expect(fragmentUsers.length).toBeGreaterThan(0)
expect(fragmentUsers).toHaveLength(fragment.recommendations.length) expect(fragmentUsers).toHaveLength(fragment.recommendations.length)
}) })
it('should return an error when the collection does not have a handling editor', async () => {
const { collection } = testFixtures.collections
const { fragment } = testFixtures.fragments
const fragmentHelper = new Fragment({ fragment })
delete collection.handlingEditor
try {
await fragmentHelper.getReviewersAndEditorsData({
collection,
UserModel: models.User,
})
} catch (e) {
expect(e.message).toEqual(
`Collection ${collection.id} does not have a Handling Editor`,
)
}
})
}) })
}) })
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