Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement email domain validation with unit tests #143

Merged
merged 26 commits into from
Sep 25, 2020

Conversation

jia1
Copy link
Member

@jia1 jia1 commented Aug 17, 2020

Problem

This pull request enables forms to have email domain validation for the email field.

Closes #54

Before & After Screenshots

BEFORE:
Screen Shot 2020-08-17 at 12 02 38 PM

AFTER:
Screenshot 2020-09-23 at 10 12 56 PM
Screenshot 2020-09-23 at 10 13 13 PM
Screenshot 2020-09-23 at 10 13 38 PM
Screenshot 2020-09-23 at 10 13 53 PM
Screenshot 2020-09-23 at 10 14 01 PM
Screenshot 2020-09-23 at 10 14 12 PM
Screenshot 2020-09-23 at 10 14 27 PM
Screenshot 2020-09-23 at 10 14 52 PM
Screenshot 2020-09-23 at 10 15 00 PM

@liangyuanruo
Copy link
Contributor

@karrui could you help look into @jia1 's code and help her to get her tests to pass?

Copy link
Contributor

@karrui karrui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some interim comments till the backend validation is also performed; feel free to ping me on Slack anytime for queries.

If possible, try to also add tests for the email field schema in tests/unit/backend/models/form_fields.schema.spec.ts or even create a new test file tests/unit/backend/models/formFields/email.schema.spec.ts!

You can refer to createAndReturnFormField method in form_fields test file to retrieve a single form field with the email type to test with.

src/app/models/field/emailField.ts Outdated Show resolved Hide resolved
src/app/models/field/emailField.ts Outdated Show resolved Hide resolved
src/app/models/field/emailField.ts Outdated Show resolved Hide resolved
src/app/models/field/emailField.ts Outdated Show resolved Hide resolved
src/app/models/field/emailField.ts Outdated Show resolved Hide resolved
@karrui
Copy link
Contributor

karrui commented Sep 18, 2020

I'll take a look at why the tests are failing on Monday and advise you on next steps :D

…ains placeholder and migrate email validation tests
@jia1 jia1 marked this pull request as ready for review September 21, 2020 06:40
Copy link
Contributor

@karrui karrui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for all the hard work, we are almost there! Just a few more changes :D

…rt require and add a warning to prevent changes to onclick=""
Copy link
Contributor

@karrui karrui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm 👍

@jia1 jia1 merged commit 43092b1 into develop Sep 25, 2020
@jia1 jia1 deleted the feat/email-domain-validation branch September 25, 2020 06:57
@jia1 jia1 self-assigned this Sep 29, 2020
@jia1 jia1 added contribute free for contributors to pick up enhancement New feature or request P3 labels Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribute free for contributors to pick up enhancement New feature or request P3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Email domain restriction
3 participants