diff --git a/packages/component-helper-service/src/tests/fragment.test.js b/packages/component-helper-service/src/tests/fragment.test.js index b546cbe384a37a442cd2343defab605231e3047a..02526753141662501695d100ed8bad8f00174367 100644 --- a/packages/component-helper-service/src/tests/fragment.test.js +++ b/packages/component-helper-service/src/tests/fragment.test.js @@ -253,5 +253,22 @@ describe('Fragment helper', () => { expect(fragmentUsers.length).toBeGreaterThan(0) 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`, + ) + } + }) }) })