From 573a84225d7bbd3321d0567a90fef716c39a0851 Mon Sep 17 00:00:00 2001
From: Anca Ursachi <anca.ursachi@thinslices.com>
Date: Mon, 22 Oct 2018 18:20:36 +0300
Subject: [PATCH] fix(fixPipelineProblems):

---
 .../xpub-faraday/config/authsome-helpers.js   |  2 -
 .../tests/config/authsome-helpers.test.js     | 84 -------------------
 2 files changed, 86 deletions(-)

diff --git a/packages/xpub-faraday/config/authsome-helpers.js b/packages/xpub-faraday/config/authsome-helpers.js
index 14747802b..1f885f1b2 100644
--- a/packages/xpub-faraday/config/authsome-helpers.js
+++ b/packages/xpub-faraday/config/authsome-helpers.js
@@ -4,10 +4,8 @@ const logger = require('@pubsweet/logger')
 
 const statuses = config.get('statuses')
 
-const keysToOmit = ['email', 'id']
 const publicStatusesPermissions = ['author', 'reviewer']
 const authorAllowedStatuses = ['revisionRequested', 'rejected', 'accepted']
-const authorCanViewHENameStatuses = ['rejected', 'accepted']
 
 const parseAuthorsData = (coll, matchingCollPerm) => {
   if (['reviewer'].includes(matchingCollPerm.permission)) {
diff --git a/packages/xpub-faraday/tests/config/authsome-helpers.test.js b/packages/xpub-faraday/tests/config/authsome-helpers.test.js
index ced5b1e95..0e51ce6ae 100644
--- a/packages/xpub-faraday/tests/config/authsome-helpers.test.js
+++ b/packages/xpub-faraday/tests/config/authsome-helpers.test.js
@@ -9,90 +9,6 @@ describe('Authsome Helpers', () => {
     testFixtures = cloneDeep(fixturesService.fixtures)
     models = fixturesService.Model.build(testFixtures)
   })
-  it('stripeCollection - should return collection', () => {
-    const { collection } = testFixtures.collections
-    const result = ah.stripeCollectionByRole({ collection })
-    expect(result).toBeTruthy()
-  })
-  it('stripeFragment - should return fragment', () => {
-    const { fragment } = testFixtures.fragments
-    const result = ah.stripeFragmentByRole({ fragment })
-    expect(result).toBeTruthy()
-  })
-
-  it('stripeCollection - author should not see accepted HE name before recommendation made', () => {
-    const { collection } = testFixtures.collections
-    collection.status = 'underReview'
-    collection.handlingEditor = {
-      ...collection.handlingEditor,
-      isAccepted: true,
-    }
-
-    const role = 'author'
-    const result = ah.stripeCollectionByRole({ collection, role })
-    const { handlingEditor = {} } = result
-
-    expect(handlingEditor.email).toBeFalsy()
-    expect(handlingEditor.name).toEqual('Assigned')
-  })
-
-  it('stripeCollection - author should not see Assigned until HE accepted ', () => {
-    const { collection } = testFixtures.collections
-    collection.status = 'underReview'
-    collection.handlingEditor = {
-      ...collection.handlingEditor,
-      isAccepted: false,
-    }
-
-    const role = 'author'
-    const result = ah.stripeCollectionByRole({ collection, role })
-    const { handlingEditor = {} } = result
-
-    expect(handlingEditor).toBeFalsy()
-    expect(handlingEditor.name).not.toEqual('Assigned')
-  })
-
-  it('stripeCollection - author should see HE name after recommendation made', () => {
-    const { collection } = testFixtures.collections
-    collection.status = 'revisionRequested'
-
-    const role = 'author'
-    const result = ah.stripeCollectionByRole({ collection, role })
-    const { handlingEditor = {} } = result
-
-    expect(handlingEditor.name).not.toEqual('Assigned')
-  })
-
-  it('stripeCollection - other user than author should see HE name before recommendation made', () => {
-    const { collection } = testFixtures.collections
-    collection.status = 'underReview'
-
-    const role = 'admin'
-    const result = ah.stripeCollectionByRole({ collection, role })
-    const { handlingEditor = {} } = result
-
-    expect(handlingEditor.name).not.toEqual('Assigned')
-  })
-
-  it('stripeCollection - other user than author should see HE name after recommendation made', () => {
-    const { collection } = testFixtures.collections
-    collection.status = 'revisionRequested'
-
-    const role = 'admin'
-    const result = ah.stripeCollectionByRole({ collection, role })
-    const { handlingEditor = {} } = result
-
-    expect(handlingEditor.name).not.toEqual('Assigned')
-  })
-
-  it('stripeCollection - returns if collection does not have HE', () => {
-    const { collection } = testFixtures.collections
-    delete collection.handlingEditor
-
-    const role = 'admin'
-    const result = ah.stripeCollectionByRole({ collection, role })
-    expect(result.handlingEditor).toBeFalsy()
-  })
 
   describe('stripeFragmentByRole', () => {
     it('reviewer should not see authors email', () => {
-- 
GitLab