-
Notifications
You must be signed in to change notification settings - Fork 4
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(textInput): add emoji filtering by default for text inputs #89
base: develop
Are you sure you want to change the base?
Conversation
Agregar unit test, de todos los casos |
|
@@ -43,6 +43,34 @@ describe('handleChangeText', () => { | |||
should(result.answer).be.undefined(); | |||
}); | |||
}); | |||
|
|||
context('with an answer including emojis', () => { | |||
it('should sanitize it by default', () => { |
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.
Excelente!
* @param {String} value The new answer to be handled. | ||
* @param {Function} onChange Handle when the answer has changed. | ||
*/ | ||
const handleChangeText = ({name, regex}, value, onChange) => onChange({ | ||
[name]: !isEmpty(value) ? formatValue(value, regex) : undefined | ||
const handleChangeText = ({name, regex, allowEmojis = false}, value, onChange) => onChange({ |
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.
Ahora que lo veo mejor, hace lo mismo que el formatValue()
👀.
Se puede simplificar más si concantenás las regex en una sola: https://stackoverflow.com/a/185529. Lo interesante ahora va a ser que el test siga dando verde cuando modifiques la implementación, prescindiendo del sanitize()
.
No description provided.