diff --git a/src/components/Interpretations/common/__tests__/getInterpretationAccess.spec.js b/src/components/Interpretations/common/__tests__/getInterpretationAccess.spec.js index 907427664..3dc62633f 100644 --- a/src/components/Interpretations/common/__tests__/getInterpretationAccess.spec.js +++ b/src/components/Interpretations/common/__tests__/getInterpretationAccess.spec.js @@ -1,5 +1,4 @@ import { - hasAuthority, getInterpretationAccess, getCommentAccess, } from '../getInterpretationAccess.js' @@ -35,18 +34,6 @@ const userJane = { } describe('interpretation and comment access', () => { - describe('hasAuthority', () => { - it('throws an error when no authority is provided', () => { - expect(() => hasAuthority([], undefined)).toThrow( - '"hasAuthority" requires "authority" to be a populated string but received undefined' - ) - }) - it('throws an error when authority is not a string', () => { - expect(() => hasAuthority([], 12)).toThrow( - '"hasAuthority" requires "authority" to be a populated string but received 12' - ) - }) - }) describe('getInterpretationAccess', () => { it('returns true for all accesses for superuser', () => { const interpretation = { diff --git a/src/components/Interpretations/common/getInterpretationAccess.js b/src/components/Interpretations/common/getInterpretationAccess.js index 839446fce..1723b9e4c 100644 --- a/src/components/Interpretations/common/getInterpretationAccess.js +++ b/src/components/Interpretations/common/getInterpretationAccess.js @@ -1,6 +1,6 @@ // For backwards compatibility // accept both Set (from the old d2.currentUser object) and array -export const hasAuthority = (authorities, authority) => { +const hasAuthority = (authorities, authority) => { if (!authority || typeof authority !== 'string') { throw new Error( `"hasAuthority" requires "authority" to be a populated string but received ${authority}`