NeoScan_Physician/app/modules/Auth/__tests__/BiometricLogin.test.tsx

30 lines
908 B
TypeScript

/*
* File: BiometricLogin.test.tsx
* Description: Test for BiometricLogin component
* Design & Developed by Tech4Biz Solutions
* Copyright (c) Spurrin Innovations. All rights reserved.
*/
import React from 'react';
import { render, fireEvent } from '@testing-library/react-native';
import BiometricLogin from '../components/BiometricLogin';
jest.mock('../hooks/useBiometric', () => ({
useBiometric: () => ({ authenticate: jest.fn() })
}));
describe('BiometricLogin', () => {
it('renders button and triggers handler', () => {
const { getByText } = render(<BiometricLogin />);
const button = getByText('Login with Biometric');
expect(button).toBeTruthy();
fireEvent.press(button);
// No error means handler is called
});
});
/*
* End of File: BiometricLogin.test.tsx
* Design & Developed by Tech4Biz Solutions
* Copyright (c) Spurrin Innovations. All rights reserved.
*/