diff --git a/app/soapbox/features/auth_login/components/__tests__/login_form.test.js b/app/soapbox/features/auth_login/components/__tests__/login_form.test.js
index 2260e3387..ac1c52930 100644
--- a/app/soapbox/features/auth_login/components/__tests__/login_form.test.js
+++ b/app/soapbox/features/auth_login/components/__tests__/login_form.test.js
@@ -1,31 +1,41 @@
import { Map as ImmutableMap } from 'immutable';
import React from 'react';
-import { render, screen } from '../../../../jest/test-helpers';
+import { fireEvent, render, screen } from '../../../../jest/test-helpers';
import LoginForm from '../login_form';
describe('', () => {
it('renders for Pleroma', () => {
+ const mockFn = jest.fn();
const store = {
instance: ImmutableMap({
version: '2.7.2 (compatible; Pleroma 2.3.0)',
}),
};
- render(, null, store);
+ render(, null, store);
- expect(screen.getByRole('heading')).toHaveTextContent('Sign In');
+ expect(screen.getByRole('heading')).toHaveTextContent(/sign in/i);
});
it('renders for Mastodon', () => {
+ const mockFn = jest.fn();
const store = {
instance: ImmutableMap({
version: '3.0.0',
}),
};
- render(, null, store);
+ render(, null, store);
- expect(screen.getByRole('heading')).toHaveTextContent('Sign In');
+ expect(screen.getByRole('heading')).toHaveTextContent(/sign in/i);
+ });
+
+ it('responds to the handleSubmit prop', () => {
+ const mockFn = jest.fn();
+ render();
+ fireEvent.submit(screen.getByTestId(/button/i));
+
+ expect(mockFn).toHaveBeenCalledTimes(1);
});
});
diff --git a/app/soapbox/features/auth_login/components/login_form.js b/app/soapbox/features/auth_login/components/login_form.js
index a5c8df5df..965473c25 100644
--- a/app/soapbox/features/auth_login/components/login_form.js
+++ b/app/soapbox/features/auth_login/components/login_form.js
@@ -66,6 +66,7 @@ const LoginForm = ({ isLoading, handleSubmit }) => {
required
/>
+