Conversation
5946cc2 to
e99f909
Compare
| <span | ||
| className={classnames( | ||
| // Add some vertical padding so that the dropdown has some space | ||
| 'py-1', |
There was a problem hiding this comment.
This padding has been moved to one of the children, making this wrapper no longer needed.
| // wrapper is needed to serve as the flex layout for the label and indicator content. | ||
| className="flex items-center gap-x-1" |
There was a problem hiding this comment.
It turns out this wrapper is actually not needed, as the button itself is already a flex container. Only the gap-x-1 had to be set there.
e99f909 to
e2f8d82
Compare
| const img = mount(<div>{label}</div>).find('img'); | ||
| assert.equal(img.prop('src'), 'test-icon'); | ||
| }); | ||
|
|
||
| it('does not render an icon if the the publisher-provided icon is missing', () => { | ||
| const wrapper = createGroupList(); | ||
| const label = wrapper.find('Menu').prop('label'); | ||
| assert.isFalse(mount(label).find('img').exists()); | ||
| assert.isFalse( | ||
| mount(<div>{label}</div>) | ||
| .find('img') | ||
| .exists(), | ||
| ); |
There was a problem hiding this comment.
The label is now a fragment, so it needs to be wrapped in an element to allow mounting.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7292 +/- ##
=======================================
Coverage 99.46% 99.46%
=======================================
Files 271 271
Lines 10930 10930
Branches 2614 2614
=======================================
Hits 10872 10872
Misses 58 58 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
robertknight
left a comment
There was a problem hiding this comment.
Looks fine from a brief test.
This is an intermediary step part of hypothesis/product-backlog#1660
This PR reduces the amount of nested DOM elements in
MenuandGroupList, so that it is possible to make the group name truncate as much as the horizontal space allows, without affecting other elements.This PR does not yet solve the issue in hypothesis/product-backlog#1660, and should not produce any visual changes.
Tip
This PR is easier to review hiding whitespaces