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

Add tests #17

Open
GermaVinsmoke opened this issue Oct 28, 2019 · 5 comments
Open

Add tests #17

GermaVinsmoke opened this issue Oct 28, 2019 · 5 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@GermaVinsmoke
Copy link
Owner

Add tests to test App.jsx and Bar.jsx

@GermaVinsmoke GermaVinsmoke added help wanted Extra attention is needed good first issue Good for newcomers labels Oct 28, 2019
@Larissagilliane
Copy link
Contributor

I can help with that

@GermaVinsmoke
Copy link
Owner Author

Thanks for helping with this issue. I think it'll also teach me a lot about the testing environment as I am a beginner in this. 😅

@Larissagilliane
Copy link
Contributor

@GermaVinsmoke can i open a new issue to refactor the folder organization ?

@GermaVinsmoke
Copy link
Owner Author

Yeah

@Larissagilliane
Copy link
Contributor

@GermaVinsmoke i think you need to do some changes in your code to turn easier to test your components. For example you can avoid magic numbers using constants, like in if (len > 7) newVal = newVal.slice(1, len); instead using those number directly you should use constants in another file and calling them.

It's a good practice to use const instead of let when the value that you're using will not change, it is safer guarantee that his value is a constant.

Another point is that you're calculating a lot of bussiness logic inside 'handleChange', it's not wrong, but you could do that in another function for example.

You can open new PR's if you want, or just ignore all these considetations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants