NeoScan_Physician/app/modules/Auth/__tests__/authAPI.test.ts

26 lines
810 B
TypeScript

/*
* File: authAPI.test.ts
* Description: Test for authAPI service
* Design & Developed by Tech4Biz Solutions
* Copyright (c) Spurrin Innovations. All rights reserved.
*/
import { authAPI } from '../services/authAPI';
jest.mock('apisauce', () => ({
create: () => ({ post: jest.fn(() => Promise.resolve({ ok: true, data: { id: '1', name: 'Dr. Smith', email: 'dr@hospital.com' } })) })
}));
describe('authAPI', () => {
it('calls login and returns data', async () => {
const response = await authAPI.login('dr@hospital.com', 'password');
expect(response.ok).toBe(true);
expect(response.data).toHaveProperty('email', 'dr@hospital.com');
});
});
/*
* End of File: authAPI.test.ts
* Design & Developed by Tech4Biz Solutions
* Copyright (c) Spurrin Innovations. All rights reserved.
*/