Skip to content

Conversation

@diglesias17
Copy link
Contributor

No description provided.

@mdumrauf
Copy link
Contributor

Agregar unit test, de todos los casos

@diglesias17
Copy link
Contributor Author

Agregar unit test, de todos los casos

@diglesias17 diglesias17 closed this Mar 1, 2019
@diglesias17 diglesias17 reopened this Mar 1, 2019
});

context('with an answer including emojis', () => {
it('should sanitize it by default', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Excelente!

*/
const handleChangeText = ({name, regex}, value, onChange) => onChange({
[name]: !isEmpty(value) ? formatValue(value, regex) : undefined
const handleChangeText = ({name, regex, allowEmojis = false}, value, onChange) => onChange({
Copy link
Contributor

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().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants