diff --git a/apps/server/src/infra/authorization-client/error/authorization-error.loggable-exception.spec.ts b/apps/server/src/infra/authorization-client/error/authorization-error.loggable-exception.spec.ts deleted file mode 100644 index 40831a5212a..00000000000 --- a/apps/server/src/infra/authorization-client/error/authorization-error.loggable-exception.spec.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { Action, AuthorizationBodyParamsReferenceType } from '../authorization-api-client'; -import { AuthorizationErrorLoggableException } from './authorization-error.loggable-exception'; - -describe('AuthorizationErrorLoggableException', () => { - describe('getLogMessage', () => { - const setup = () => { - const error = new Error('testError'); - - const params = { - context: { - action: Action.READ, - requiredPermissions: [], - }, - referenceType: AuthorizationBodyParamsReferenceType.COURSES, - referenceId: 'someReferenceId', - }; - - const exception = new AuthorizationErrorLoggableException(error, params); - - return { - error, - exception, - params, - }; - }; - - it('should log the correct message', () => { - const { error, exception, params } = setup(); - - const result = exception.getLogMessage(); - - expect(result).toEqual({ - type: 'INTERNAL_SERVER_ERROR', - error, - stack: expect.any(String), - data: { - action: params.context.action, - referenceId: params.referenceId, - referenceType: params.referenceType, - requiredPermissions: params.context.requiredPermissions.join(','), - }, - }); - }); - }); -}); diff --git a/apps/server/src/infra/authorization-client/error/authorization-forbidden.loggable-exception.spec.ts b/apps/server/src/infra/authorization-client/error/authorization-forbidden.loggable-exception.spec.ts deleted file mode 100644 index 75b19806969..00000000000 --- a/apps/server/src/infra/authorization-client/error/authorization-forbidden.loggable-exception.spec.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { AuthorizationForbiddenLoggableException } from './authorization-forbidden.loggable-exception'; -import { Action, AuthorizationBodyParamsReferenceType } from '../authorization-api-client'; - -describe('AuthorizationForbiddenLoggableException', () => { - describe('getLogMessage', () => { - const setup = () => { - const params = { - context: { - action: Action.READ, - requiredPermissions: [], - }, - referenceType: AuthorizationBodyParamsReferenceType.COURSES, - referenceId: 'someReferenceId', - }; - - const exception = new AuthorizationForbiddenLoggableException(params); - - return { - exception, - params, - }; - }; - - it('should log the correct message', () => { - const { exception, params } = setup(); - - const result = exception.getLogMessage(); - - expect(result).toEqual({ - type: 'FORBIDDEN_EXCEPTION', - stack: expect.any(String), - data: { - action: params.context.action, - referenceId: params.referenceId, - referenceType: params.referenceType, - requiredPermissions: params.context.requiredPermissions.join(','), - }, - }); - }); - }); -});