diff --git a/app/tests/unit_test/biometricAuth.test.js b/app/tests/unit_test/biometricAuth.test.js new file mode 100644 index 0000000..e19eaef --- /dev/null +++ b/app/tests/unit_test/biometricAuth.test.js @@ -0,0 +1,18 @@ +import React from 'react'; +import { render, fireEvent } from '@testing-library/react-native'; +import BiometricAuth from './BiometricAuth'; + +describe('BiometricAuth', () => { + it('renders correctly', () => { + const { getByText } = render(); + expect(getByText('Authenticate with Biometrics')).toBeTruthy(); + }); + + it('calls onAuthenticate when button is pressed', () => { + const onAuthenticate = jest.fn(); + const { getByText } = render(); + const button = getByText('Authenticate'); + fireEvent.press(button); + expect(onAuthenticate).toHaveBeenCalledTimes(1); + }); +});