TorstenDittmann / OmniaWrite

A text editor engineered for creative writing.
https://OmniaWrite.com
Apache License 2.0
161 stars 34 forks source link

[important] write tests #36

Closed TorstenDittmann closed 4 years ago

TorstenDittmann commented 4 years ago

This one is scary, since there is zero tests so far in this project 😨

But is essential for the future.

fredericbonnet commented 4 years ago

Hi! I will be more than happy to help you on this issue. I have a good experience with a variety of testing frameworks and tools, from unit to E2E testings. I have never used Svelte but it looks like a great opportunity to discover this framework!

TorstenDittmann commented 4 years ago

That would be amazing!

I actually started working on this some days ago, but stopped after I had trouble testing Svelte components that import other Svelte components.

https://github.com/TorstenDittmann/OmniaWrite/blob/dev/jest.config.js https://github.com/TorstenDittmann/OmniaWrite/blob/dev/tests/Button.spec.js

As you can see there I added tests for the button, but once I tried it for the Input component it had trouble because the Input was importing the Label component as well.

If you could find a fix for that, that would be the perfect starting point for me to write the remaining tests 🙂

fredericbonnet commented 4 years ago

I plan to start by integrating Storybook to the project. It's a great way to structure tests for a web app, thanks to its component-oriented visual testing approach. The Getting Started guide includes setting up Jest along with Storybook so it also gives a good foundation for unit tests once everything is in place.

fredericbonnet commented 4 years ago

Hi! I've made some progress on visual testing with Storybook, and I'd like to submit a PR with my branch so you can check whether it suits your needs and in which direction you want to go further. However, you may know that DigitalOcean made some changes to the Hacktoberfest rules following the debacle of the first days (hundreds of spammy PRs submitted on many projects after some guy made a video on how to get free T-shirts!). Project maintainers now have to opt-in with the hacktoberfest tag just like you did with some of your issues, however I'm not sure whether it applies project-wide or on specific issues only. So just to be on the safe side can you add this tag to this specific issue before ? Thx!

The branch is here BTW: https://github.com/fredericbonnet/OmniaWrite/tree/tests

TorstenDittmann commented 4 years ago

Thanks for the work, feel free to open a PR to the dev branch and I can review and comment on that.

Following your concerns I have added that label to the issue 😉

fredericbonnet commented 4 years ago

Cool, I'm pushing my branch right now!