Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- test('email field is missing', () => {
- const actual = getSignupFormFieldErrors({
- username: 'foo',
- password: 'pass',
- passwordConfirmation: 'pass',
- });
- const expected = {
- email: MISSING_FIELD,
- };
- expect(actual).toEqual(expected);
- });
- test('password field is missing', () => {
- const actual = getSignupFormFieldErrors({
- email: 'foo@example.com',
- username: 'foo',
- passwordConfirmation: 'pass',
- });
- const expected = {
- password: MISSING_FIELD,
- };
- expect(actual).toEqual(expected);
- });
- test('passwordConfirmation field is missing', () => {
- const actual = getSignupFormFieldErrors({
- email: 'foo@example.com',
- username: 'foo',
- password: 'pass',
- });
- const expected = {
- passwordConfirmation: MISSING_FIELD,
- };
- expect(actual).toEqual(expected);
- });
- test('many fields are missing', () => {
- const actual = getSignupFormFieldErrors({
- username: 'foo',
- password: 'pass',
- });
- const expected = {
- email: MISSING_FIELD,
- passwordConfirmation: MISSING_FIELD,
- };
- expect(actual).toEqual(expected);
- });
Add Comment
Please, Sign In to add comment