• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

atlp-rwanda / vikings-ec-fe / a2e058da-2c78-40f1-b0d3-0ffea5a6daab

pending completion
a2e058da-2c78-40f1-b0d3-0ffea5a6daab

push

circleci

GitHub
feat: update password (#17)

51 of 104 branches covered (49.04%)

Branch coverage included in aggregate %.

30 of 30 new or added lines in 3 files covered. (100.0%)

407 of 476 relevant lines covered (85.5%)

7.44 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

87.5
/src/validations/inputValidation.js
1
import * as yup from 'yup';
2

3
export const loginSchema = yup.object().shape({
21✔
4
  email: yup.string().email('Email is invalid').required('Email is required'),
5
  password: yup
6
    .string()
7
    .min(8, 'Password must be at least 8 characters long')
8
    .required('Password is required'),
9
});
10
export const forgotPasswordSchema = yup.object().shape({
21✔
11
  email: yup.string().email('Email is invalid').required('Email is required'),
12
});
13
export const resetPasswordSchema = yup.object().shape({
21✔
14
  newPassword: yup
15
    .string()
16
    .min(8, 'Password must be at least 8 characters long')
17
    .required('Password is required'),
18
  confirmPassword: yup
19
    .string()
20
    .required('Confirm password is required')
21
    .test('passwords-match', 'Passwords must match', function (value) {
22
      return this.parent.newPassword === value;
×
23
    }),
24

25
});
26

27
export const registerSchema = yup.object().shape({
21✔
28
  firstname: yup.string().min(3).trim().required(),
29
  lastname: yup.string().min(3).trim().required(),
30
  email: yup.string().email().lowercase().trim()
31
    .required(),
32
  phone: yup.string().matches(/^\+?[1-9][0-9]{7,14}$/),
33
  password: yup
34
    .string()
35
    .min(8, 'Password must be at least 8 characters')
36
    .matches(/[A-Z]/, 'Password must contain at least one uppercase character')
37
    .matches(/[0-9]/, 'Password must contain at least one numeric character')
38
    .required('Password is required')
39
    .trim(),
40
});
41

42
export const accountSchema = yup.object().shape({
21✔
43
  firstname: yup.string().min(3).trim().required(),
44
  lastname: yup.string().min(3).trim().required(),
45
  email: yup.string().email().lowercase().trim()
46
    .required(),
47
  gender: yup.string().required('Your gender is required'),
48
  birthdate: yup.date().required('Your birthdate is required'),
49
  phone: yup.string().matches(/^\+?[1-9][0-9]{7,14}$/),
50
});
51

52
export const addressSchema = yup.object().shape({
21✔
53
  country: yup.string().required('Country is required'),
54
  state: yup.string(),
55
  province: yup.string(),
56
  city: yup.string(),
57
  streetAddress: yup.string().required('Street is required'),
58
  zipCode: yup.string(),
59
});
60
export const updatePasswordSchema = yup.object().shape({
21✔
61
  old_password: yup
62
    .string()
63
    .required('Password is required'),
64
  new_password: yup
65
    .string()
66
    .min(8, 'Password must be at least 8 characters long')
67
    .matches(/[A-Z]/, 'Password must contain at least one uppercase character')
68
    .matches(/[0-9]/, 'Password must contain at least one numeric character')
69
    .required('Password is required')
70
    .trim(),
71
});
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc