diff --git a/packages/material-ui/src/ListItemText/ListItemText.js b/packages/material-ui/src/ListItemText/ListItemText.js index 4e8e569e14670c..8de227c4c691bc 100644 --- a/packages/material-ui/src/ListItemText/ListItemText.js +++ b/packages/material-ui/src/ListItemText/ListItemText.js @@ -47,8 +47,8 @@ function ListItemText(props, context) { } = props; const { dense } = context; - let primary = primaryProp || children; - if (primary && !disableTypography) { + let primary = primaryProp != null ? primaryProp : children; + if (primary != null && !disableTypography) { primary = ( ', () => { const wrapper = shallow({primary}); assert.strictEqual(wrapper.contains(primary), true, 'should find the node'); }); + + it('should read 0 as primary', () => { + const wrapper = shallow(); + assert.strictEqual(wrapper.childAt(0).type(), Typography); + }); }); describe('prop: secondary', () => { @@ -91,6 +96,11 @@ describe('', () => { const wrapper = shallow(); assert.strictEqual(wrapper.contains(secondary), true, 'should find the node'); }); + + it('should read 0 as secondary', () => { + const wrapper = shallow(); + assert.strictEqual(wrapper.childAt(0).type(), Typography); + }); }); describe('prop: disableTypography', () => {