Replies: 1 comment
-
|
Absolutely, it makes a lot of sense to publish some test helpers :) I've had the same frustrations as you're having when working with tests for this. Comparing symbols is relatively easy, and comparing modifiers and colors is quite hard. Any progress towards a better solution is good 👍 The thing I would really want to do is actually render the screens and compare with a checked in version, like snapshot tests. Not sure how to proceed in that direction however. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
So while writing some tests I noticed that I was copying quite a bit of logic that you used in here for some of the widgets. For example I used:
What do you think of publishing some sort of test-utils package with some of this stuff extracted out so that users could re-use some of it. Would you be open to a PR exploring this?
One thing I had a somewhat hard time with figuring out how to test was colors/modifiers. I noticed that in some of your tests you do this sort of thing where you go over the expected ranges and apply a modifier to them. That works for small things, but having a full UI with various colors/dim/bold text gets really hard to follow that pattern with. One way around this for me was to make a copy of diffBuffers with the key difference being it only compares the actual symbols. Would you be open to a small change that maybe deprecates this method and adds another that has a flag that can be turned on or off to do a full diff that includes things like modifiers, vs a more minimal one that just does the symbols?
Beta Was this translation helpful? Give feedback.
All reactions