-
Notifications
You must be signed in to change notification settings - Fork 87
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
Conversation
There was a problem hiding this 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/public/modules/forms/admin/controllers/edit-fields-modal.client.controller.js
Outdated
Show resolved
Hide resolved
src/public/modules/forms/admin/controllers/edit-fields-modal.client.controller.js
Outdated
Show resolved
Hide resolved
src/public/modules/forms/base/components/field-email.client.component.js
Outdated
Show resolved
Hide resolved
tests/unit/backend/utils/field-validation/email-validation.spec.js
Outdated
Show resolved
Hide resolved
…es from controllers
…ltip for email domain fields
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
…e below the field and prevent error when textarea value is empty (cannot call .split on empty string)
… exist on type 'IEmailFieldSchema'.
There was a problem hiding this 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
src/public/modules/forms/admin/controllers/edit-fields-modal.client.controller.js
Outdated
Show resolved
Hide resolved
src/public/modules/forms/admin/views/edit-fields.client.modal.html
Outdated
Show resolved
Hide resolved
tests/unit/backend/utils/field-validation/email-validation.spec.ts
Outdated
Show resolved
Hide resolved
…rt require and add a warning to prevent changes to onclick=""
…ously extend types 'IEmailField' and 'IFieldSchema'.
… allowedEmailDomainsFromText
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm 👍
Problem
This pull request enables forms to have email domain validation for the email field.
Closes #54
Before & After Screenshots
BEFORE:
AFTER: