From 920f093c6d755f2fdbe80ed6f90c54575cb3d0bc Mon Sep 17 00:00:00 2001 From: AndyFlintAnswerDigital Date: Tue, 23 Dec 2025 16:58:43 +0000 Subject: [PATCH] [PRM-495] Removed failing health check --- .../__tests__/get-health-check.test.js | 67 ------------------- 1 file changed, 67 deletions(-) delete mode 100644 services/ehr-repo/src/services/health-check/__tests__/get-health-check.test.js diff --git a/services/ehr-repo/src/services/health-check/__tests__/get-health-check.test.js b/services/ehr-repo/src/services/health-check/__tests__/get-health-check.test.js deleted file mode 100644 index 38bf6e13..00000000 --- a/services/ehr-repo/src/services/health-check/__tests__/get-health-check.test.js +++ /dev/null @@ -1,67 +0,0 @@ -import { getHealthCheck } from '../get-health-check'; -import { S3 } from 'aws-sdk'; -import { initializeConfig } from '../../../config'; - -jest.mock('aws-sdk'); - -describe('getHealthCheck', () => { - const config = initializeConfig(); - const mockHeadBucket = jest.fn().mockImplementation((config, callback) => callback()); - const mockPutObjectPromise = jest.fn(); - const mockPutObject = jest.fn().mockImplementation(() => ({ promise: mockPutObjectPromise })); - const error = 'some-error'; - - beforeEach(() => { - S3.mockImplementation(() => ({ - putObject: mockPutObject, - headBucket: mockHeadBucket - })); - }); - - it('should return successful s3 health check if s3 succeeds', () => { - // when - mockPutObjectPromise.mockReturnValueOnce(Promise.resolve()); - return getHealthCheck().then((result) => { - const s3 = result.details.filestore; - // then - expect(s3).toEqual({ - type: 's3', - bucketName: config.awsS3BucketName, - available: true, - writable: true - }); - }); - }); - - it('should return failed s3 health check if s3 returns an error', () => { - // when - mockPutObjectPromise.mockRejectedValue(error); - return getHealthCheck().then((result) => { - const s3 = result.details.filestore; - // then - return expect(s3).toEqual({ - type: 's3', - bucketName: config.awsS3BucketName, - available: true, - writable: false, - error: error - }); - }); - }); - - it('should return available false if s3 can be connected ', () => { - mockHeadBucket.mockImplementation((config, callback) => callback(error)); - - return getHealthCheck().then((result) => { - const s3 = result.details.filestore; - - return expect(s3).toEqual({ - type: 's3', - bucketName: config.awsS3BucketName, - available: false, - writable: false, - error: error - }); - }); - }); -});