Skip to content
Snippets Groups Projects
Commit b4b3de30 authored by Bogdan Cochior's avatar Bogdan Cochior
Browse files

refactor(authsome-helpers): do not mutate object

parent ee959724
No related branches found
No related tags found
1 merge request!13Sprint #14
......@@ -142,7 +142,7 @@ const stripeCollectionByRole = (coll = {}, role = '') => {
const { handlingEditor } = coll
if (!authorAllowedStatuses.includes(coll.status)) {
coll = {
return {
...coll,
handlingEditor: handlingEditor &&
handlingEditor.isAccepted && {
......
......@@ -136,7 +136,7 @@ describe('Authsome Helpers', () => {
})
expect(recommendations).toHaveLength(0)
})
it('stripeFragment - author should see reviews only if recommendation has been made', () => {
it('stripeFragment - author should see reviews only if recommendation has been made and only public ones', () => {
const { fragment } = testFixtures.fragments
fragment.recommendations = [
{
......@@ -157,7 +157,7 @@ describe('Authsome Helpers', () => {
role: 'author',
status: 'revisionRequested',
})
const privateComments = get(result, 'recommendations[0].comments')
expect(privateComments).toHaveLength(1)
const publicComments = get(result, 'recommendations[0].comments')
expect(publicComments).toHaveLength(1)
})
})
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