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

fix(manuscriptHeader): as admin/eic i should see unassigned inseted of he name until he is invited

parent 758b33d5
No related branches found
No related tags found
3 merge requests!176Sprint 24,!171Sprint 24,!168Hin 845 revoke and assign he fix
import React, { Fragment } from 'react'
import { get, chain } from 'lodash'
import { get, chain, isEmpty } from 'lodash'
import { H2, H4, DateParser, Button } from '@pubsweet/ui'
import {
compose,
......@@ -170,7 +170,9 @@ export default compose(
/>
)
}
if (!isEmpty(pendingInvitation)) {
return <Text ml={1}>{handlingEditor.name}</Text>
}
if (heInvitation) {
return <Text ml={1}>{handlingEditor.name}</Text>
}
......@@ -188,7 +190,7 @@ export default compose(
</Button>
)
}
return <Text ml={1}>{handlingEditor.name}</Text>
return <Text ml={1}>Unassigned</Text>
},
}),
setDisplayName('ManuscriptHeader'),
......
......@@ -112,11 +112,12 @@ const stripeCollectionByRole = ({ collection = {}, role = '' }) => {
return {
...collection,
handlingEditor: {
name: 'Unssigned',
name: 'Unassigned',
},
}
}
}
return collection
}
......
......@@ -19,7 +19,7 @@ describe('Authsome Helpers', () => {
expect(newCollection).toBeTruthy()
})
it('Author should not see HE name on dashboard before HE accepts invitation', () => {
it('Author should see Assigned instead of HE name on dashboard before HE accepts invitation', () => {
const { collection } = testFixtures.collections
collection.handlingEditor = {
...collection.handlingEditor,
......@@ -86,6 +86,19 @@ describe('Authsome Helpers', () => {
const { handlingEditor = {} } = newCollection
expect(handlingEditor.name).not.toEqual('Assigned')
})
it('Author should see Unassigned insted of HE name before HE is invited', () => {
const { collection } = testFixtures.collections
collection.status = 'submitted'
const role = 'author'
const newCollection = ah.stripeCollectionByRole({
collection,
role,
})
const { handlingEditor = {} } = newCollection
expect(handlingEditor.name).toEqual('Unassigned')
})
it('stripeCollection - returns if collection does not have HE', () => {
const { collection } = testFixtures.collections
delete collection.handlingEditor
......
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