NeoScan_Physician/app/modules/Dashboard/__tests__/caseAPI.test.ts

26 lines
715 B
TypeScript

/*
* File: caseAPI.test.ts
* Description: Test for caseAPI service
* Design & Developed by Tech4Biz Solutions
* Copyright (c) Spurrin Innovations. All rights reserved.
*/
import { caseAPI } from '../services/caseAPI';
jest.mock('apisauce', () => ({
create: () => ({ get: jest.fn(() => Promise.resolve({ ok: true, data: [] })) })
}));
describe('caseAPI', () => {
it('calls getCases and returns data', async () => {
const response = await caseAPI.getCases();
expect(response.ok).toBe(true);
expect(Array.isArray(response.data)).toBe(true);
});
});
/*
* End of File: caseAPI.test.ts
* Design & Developed by Tech4Biz Solutions
* Copyright (c) Spurrin Innovations. All rights reserved.
*/