Skip to content
This repository has been archived by the owner on Feb 27, 2020. It is now read-only.

Commit

Permalink
fix(interiorleftnav): support custom title node (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
flannanl authored and zeusorion committed Oct 24, 2019
1 parent f77c4c0 commit 1b9dbfa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('InteriorLeftNavList', () => {
);

const expectedChildrenList = shallow(
<InteriorLeftNavList>
<InteriorLeftNavList title={<div className="title-node">test-title</div>}>
<InteriorLeftNavItem href="" className="test-child">
<a href="http://www.carbondesignsystem.com">test-title</a>
</InteriorLeftNavItem>
Expand Down Expand Up @@ -68,6 +68,13 @@ describe('InteriorLeftNavList', () => {
'left-nav-list__item-icon bx--interior-left-nav__icon'
);
});
it('should render title node', () => {
expect(
expectedChildrenList.containsMatchingElement(
<div className="title-node">test-title</div>
)
).toBe(true);
});
it('should render children as expected', () => {
expect(
expectedChildrenList.find('.left-nav-list__item-link').length
Expand Down
2 changes: 1 addition & 1 deletion src/components/InteriorLeftNavList/InteriorLeftNavList.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default class InteriorLeftNavList extends Component {
className: PropTypes.string,
children: PropTypes.node,
tabIndex: PropTypes.number,
title: PropTypes.string,
title: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),
open: PropTypes.bool,
onListClick: PropTypes.func,
onItemClick: PropTypes.func,
Expand Down

0 comments on commit 1b9dbfa

Please sign in to comment.