-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[HierarchyList] Test coverage, conditional rendering, and defaultSelected expansion #904
Conversation
Deploy preview for carbon-addons-iot-react ready! Built with commit b070956 https://deploy-preview-904--carbon-addons-iot-react.netlify.com |
export const searchForItemId = (item, searchId) => { | ||
if ( | ||
// Check if the value or secondary value has a match | ||
item.id.toLowerCase().search(searchId.toLowerCase()) !== -1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't this function and searchForItemValue be refactored into one to take a list of content keys to search for so the same codebase can be shared?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactored and made a general util search function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
🎉 This PR is included in version 2.42.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Closes #892
Summary
secondaryValue
div was still being rendered, even when it was nulldefaultSelectId
's parent elements are now expanded by defaultdefaultSelectedId
Change List (commits, features, bugs, etc)
ListItem
. IfsecondaryValue
is null, it will not render, freeing up the other 50% of the widthid
defaultSelectedId
behaviortoBeTruthy()
functions renamed totoBeInTheDocument()
where applicable to give a better idea of what I am actually testing fordefaultSelectedId
's DOM elementAcceptance Test (how to verify the PR)