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

Refactor/extract functions #13

Merged
merged 11 commits into from
Dec 17, 2019
Merged

Refactor/extract functions #13

merged 11 commits into from
Dec 17, 2019

Conversation

uqmessias
Copy link
Owner

This is a big step before converting the projet to Typescript and solves #11

Copy link

@estevaolucas estevaolucas left a comment

Choose a reason for hiding this comment

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

Nice refactoring @uqmessias! It's looking great. I left some questions.

index.js Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
},
};

export const renderSvgElementByNodeWithItsChildNodes = (

Choose a reason for hiding this comment

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

what do you think of adding tests for this function in order to make sure each element has the expected result for the allowed attrs?

Copy link
Owner Author

Choose a reason for hiding this comment

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

That's a great idea, but before we do that, let me see if I understood it correctly.

What would be the purpose of these tests? To make sure that the function is rendering only the allowed attributes or to ensure that each element has the expected allowed attributes?

I'm asking that, because depending on the answer, the implementation will be different.

Choose a reason for hiding this comment

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

What would be the purpose of these tests? To make sure that the function is rendering only the allowed attributes or to ensure that each element has the expected allowed attributes?

☝️
yeah, this function with the mapping above seems to be the core of this library. So having tests for it would would give more confidence for future maintenance.

Copy link
Owner Author

Choose a reason for hiding this comment

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

I was reviewing your comment about testing this function and realize it already has its tests, besides that, the functions on the map you mentioned has tests to ensure each element is being rendered properly.

Do you think we still need more tests? If so, what do you suggest to test?

utils/transformers/index.js Show resolved Hide resolved
@uqmessias uqmessias force-pushed the refactor/extract-functions branch from 4a5ea9e to a5d2c3b Compare December 11, 2019 21:29
@uqmessias uqmessias merged commit b946f19 into master Dec 17, 2019
@uqmessias uqmessias deleted the refactor/extract-functions branch December 17, 2019 20:55
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