Snapshot-based reducer tests #2528
JackYoustra
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey all!
I love my logic tests, but it always bothered me that the tests whose primary purpose was to
display UI didn't actually test the UI! So I came up with a few mechanisms to test it.
On the slack I shared some ideas about snapshot reducer test, and want to
The primitive
First, some assumptions:
Manual submit-based tests:
These are triggered by calling a snapshotting object with the name of the thing being tested.
and then, later on
This works for my cases right now and can be easily extended to different phones, orientations, etc.
Automatic mode
The idea from this was "snapshot every action" by adding a step to the reducer.
This has a pretty good exhaustivity advantage!
Anyway, I didn't pursue this approach because
Some things I'd like to improve on but haven't figured out how:
WebImage
loads). A sleep would probably be okay here (you could probably find a better way of doing it than that, but I can't even figure out how to do that!)I'm really liking this approach to testing, but it has substantial possibilities for improvement. If anyone has any ideas on this approach (or thinks ditching it for UI test targets is a better idea), please let me know!
Beta Was this translation helpful? Give feedback.
All reactions