-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
fix badge style when logo only #10794
base: master
Are you sure you want to change the base?
Conversation
🚀 Updated review app: https://pr-10794-badges-shields.fly.dev |
Can we add snapshot test cases for this |
@chris48s Where should I add the snapshot test? The |
You should be able to finish off the tests on this one now |
1a70f04
to
2a29628
Compare
🚀 Updated review app: https://pr-10794-badges-shields.fly.dev |
There's a bug here in the case where there is a message and logo but no label: example call: https://img.shields.io/badge/just%20the%20message-blue?logo=javascript Note how the end of the message is cut off in the second image. I think those changes where you're updating the snapshot width - width="63"
+ width="49" are changing because of this bug. |
@chris48s It should be fixed now. |
🚀 Updated review app: https://pr-10794-badges-shields.fly.dev |
OK, cool. So that's that bug fixed. So now I'm just having a look over the test cases and the snapshots generated from your tests in a bit more detail. There's a few things here.. |
If we zoom back out to the original point of this issue, the thing you're actually trying to change is the case where both label and message are empty string, and that's the thing we'd like to get under test. But that is the one thing you don't seem to have added any test cases for in this PR. Every test case added in this PR has some text in either the label or message field. We already have existing tests in this file with badges with a logo for each of the 5 styles with text in the label or message so a lot of these are trying to duplicate existing test cases. I think the only new test cases we actually need to add here to cover the changes you're trying to make are:
|
@chris48s Updated, thanks for reviewing! |
Resolves #10628
It looks like there is no unit test for this. The badges below can used for previewing: