-
Notifications
You must be signed in to change notification settings - Fork 19
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
DATAP-1510 Conversion of AggregationBranch from Class to Functional Component #530
Conversation
…d associated snapshots
…nce/absence of children (can be closed by default). Also removed old snapshot.
# Conflicts: # src/components/Filters/CollapsibleFilter/CollapsibleFilter.js # src/components/Filters/CollapsibleFilter/CollapsibleFilter.spec.js # src/components/Filters/Product.js
src/components/Filters/Aggregation/AggregationBranch/AggregationBranch.js
Outdated
Show resolved
Hide resolved
desc, | ||
children, | ||
}) => { | ||
const [isOpen, setOpen] = useState(hasChildren); |
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.
I thought we got rid of hasChildren, and it should just by default be:
const [isOpen, setOpen] = useState(true);
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.
We did, but it likely made its way back in due to a merge conflict on my end. I've taken these references out again.
src/components/Filters/Aggregation/AggregationItem/AggregationItem.spec.js
Outdated
Show resolved
Hide resolved
src/components/Filters/Aggregation/AggregationBranch/AggregationBranch.js
Outdated
Show resolved
Hide resolved
title: PropTypes.string, | ||
desc: PropTypes.string, | ||
children: PropTypes.node, |
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.
These changes should be reverted.
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.
Updated
expect(buttonAfter).toBeInTheDocument(); | ||
expect(screen.getByText(props.desc)).toBeInTheDocument(); |
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.
Same with the changes in this file
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.
Updated
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.
Looks good!
You could also update the test coverage threshold in package.json if you want.
AggregationBranch conversion to functional component, along with associated unit tests
Additions
Removals
Changes
Testing
Screenshots
Notes
Todos
Checklist