react-native-collapsible-tab-view icon indicating copy to clipboard operation
react-native-collapsible-tab-view copied to clipboard

Automated tests

Open andreialecu opened this issue 4 years ago • 3 comments

Feature request

It would be great if a test suite could verify that everything is working properly. The interactions are pretty finicky and things can break in odd places by doing minor changes in others.

This would make the library much more maintainable and easier to refactor in the future, while giving more peace of mind to users that upgrades are safe.

Should be relatively easy to add gray box e2e testing using: https://github.com/wix/Detox

Tests could be added to initiate scrolls and touches, then assert whether things are positioned correctly.

Another possibility is to convert the Example app to use Storybook: https://storybook.js.org/ https://www.learnstorybook.com/intro-to-storybook/react-native/en/get-started/

It would then be possible to use loki to do screenshot diff testing for the stories (this wouldn't really test dynamic interactions though, only static rendering): https://github.com/oblador/loki

andreialecu avatar Feb 01 '21 09:02 andreialecu

@andreialecu we really need this. It was an issue with v1 and v2 (#2) to pass a ref and initiate programmatically scrolling from the tests, but now it should be easy. I'm experienced with storybook, jest, and enzyme, but not with detox. I will be looking into it thought the week to see how to set up things.

This would make the library much more maintainable and easier to refactor in the future, while giving more peace of mind to users that upgrades are safe.

❤️ 🚀

PedroBern avatar Feb 01 '21 11:02 PedroBern

React navigation uses detox with circle. We can use it as starting point.

PedroBern avatar Feb 01 '21 13:02 PedroBern

Here is a nice article about adding detox: https://medium.com/@oriharel/how-i-learned-to-stop-worrying-and-love-merging-to-master-a7e2edc0924e

PedroBern avatar Feb 01 '21 21:02 PedroBern