Guest User

Untitled

a guest
Mar 7th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. test('email field is missing', () => {
  2. const actual = getSignupFormFieldErrors({
  3. username: 'foo',
  4. password: 'pass',
  5. passwordConfirmation: 'pass',
  6. });
  7. const expected = {
  8. email: MISSING_FIELD,
  9. };
  10. expect(actual).toEqual(expected);
  11. });
  12. test('password field is missing', () => {
  13. const actual = getSignupFormFieldErrors({
  14. email: 'foo@example.com',
  15. username: 'foo',
  16. passwordConfirmation: 'pass',
  17. });
  18. const expected = {
  19. password: MISSING_FIELD,
  20. };
  21. expect(actual).toEqual(expected);
  22. });
  23. test('passwordConfirmation field is missing', () => {
  24. const actual = getSignupFormFieldErrors({
  25. email: 'foo@example.com',
  26. username: 'foo',
  27. password: 'pass',
  28. });
  29. const expected = {
  30. passwordConfirmation: MISSING_FIELD,
  31. };
  32. expect(actual).toEqual(expected);
  33. });
  34. test('many fields are missing', () => {
  35. const actual = getSignupFormFieldErrors({
  36. username: 'foo',
  37. password: 'pass',
  38. });
  39. const expected = {
  40. email: MISSING_FIELD,
  41. passwordConfirmation: MISSING_FIELD,
  42. };
  43. expect(actual).toEqual(expected);
  44. });
Add Comment
Please, Sign In to add comment