diff --git a/src/components/Main.jsx b/src/components/Main.jsx index 292326d95..58c02f45f 100644 --- a/src/components/Main.jsx +++ b/src/components/Main.jsx @@ -127,7 +127,7 @@ class AppComponent extends React.Component { ], treePickerPureSubtree: [], selectedNodes: [ - { id: '2', label: 'Norfolk Island', path: [{ id: '11', label: 'AU' }], type: '', isSelectable: false }, + { id: '2', label: 'Norfolk Island', path: [], type: '', isSelectable: false }, { id: '3', label: 'Queensland', path: [{ id: '12', label: 'AU' }], type: '' }, ], searchBarString: '', diff --git a/src/components/adslotUi/TreePickerNodeComponent.jsx b/src/components/adslotUi/TreePickerNodeComponent.jsx index 8a74d2a8d..093bed2f8 100644 --- a/src/components/adslotUi/TreePickerNodeComponent.jsx +++ b/src/components/adslotUi/TreePickerNodeComponent.jsx @@ -57,7 +57,7 @@ const TreePickerNodeComponent = ({ const labelCellProps = expanderElement ? { onClick: expandNodeBound } : {}; return ( -
+
{selected ? diff --git a/test/components/adslotUi/TreePickerNodeComponentTest.jsx b/test/components/adslotUi/TreePickerNodeComponentTest.jsx index ef9954d5b..26b7dbb1b 100644 --- a/test/components/adslotUi/TreePickerNodeComponentTest.jsx +++ b/test/components/adslotUi/TreePickerNodeComponentTest.jsx @@ -11,7 +11,7 @@ describe('TreePickerNodeComponent', () => { it('should render a node with defaults', () => { const component = shallow(); - expect(component.prop('className')).to.equal('treepickernode-component'); + expect(component.prop('className')).to.equal('treepickernode-component child-node'); expect(component.type()).to.equal('div'); const rowElement = component.find(GridRow); @@ -143,6 +143,15 @@ describe('TreePickerNodeComponent', () => { expect(valueCellElement).to.be.a('null'); }); + it('should have the child node class for child nodes', () => { + const node = _.clone(cbrNode); + node.path = [{ id: 1, label: 'AU' }]; + const props = { itemType, node }; + const component = shallow(); + + expect(component.prop('className')).to.equal('treepickernode-component child-node'); + }); + it('should fire expandNode when clicking on the `expand` cell', () => { const nodes = []; const expandNode = (node) => nodes.push(node);