Skip to content
Snippets Groups Projects
Commit 3f20002f authored by Björn Modée's avatar Björn Modée
Browse files

Add comments

parent 5d8d6d66
No related branches found
Tags 1.5.5.2
No related merge requests found
Pipeline #46046 passed with warnings
......@@ -4,6 +4,8 @@ import { Provider } from 'react-redux'
import store from '../../../store'
import AdminLogin from './AdminLogin'
/** Test AdminLogin */
it('renders admin login', () => {
render(
<Provider store={store}>
......
......@@ -20,6 +20,7 @@ interface formError {
message: string
}
/** Form logic with some requirements and constraints */
const accountSchema: Yup.SchemaOf<AccountLoginFormModel> = Yup.object({
model: Yup.object()
.shape({
......@@ -42,6 +43,8 @@ const AdminLogin: React.FC = () => {
}
setLoading(UILoading)
}, [UIErrors, UILoading])
/** dispatch with the entered values */
const handleAccountSubmit = (values: AccountLoginFormModel, actions: FormikHelpers<AccountLoginFormModel>) => {
dispatch(loginUser(values.model, history))
}
......@@ -50,6 +53,8 @@ const AdminLogin: React.FC = () => {
const accountInitialValues: AccountLoginFormModel = {
model: { email: '', password: '' },
}
/** Render the form */
return (
<Formik initialValues={accountInitialValues} validationSchema={accountSchema} onSubmit={handleAccountSubmit}>
{(formik) => (
......
......@@ -4,6 +4,8 @@ import { Provider } from 'react-redux'
import store from '../../../store'
import CompetitionLogin from './CompetitionLogin'
/** Test CompetitionLogin */
it('renders competition login', () => {
render(
<Provider store={store}>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment