We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dea1965 commit b12c38cCopy full SHA for b12c38c
test/TreeNode.js
@@ -124,4 +124,26 @@ describe('<TreeNode />', () => {
124
));
125
});
126
127
+
128
+ describe('onExpand', () => {
129
+ it('should negate the expanded property and pass the current node\'s value', () => {
130
+ let actual = {};
131
132
+ const wrapper = shallow(
133
+ <TreeNode
134
+ {...baseProps}
135
+ expanded
136
+ rawChildren={[{ value: 'europa', label: 'Europa' }]}
137
+ value="jupiter"
138
+ onExpand={(node) => {
139
+ actual = node;
140
+ }}
141
+ />,
142
+ );
143
144
+ wrapper.find('.rct-collapse').simulate('click');
145
146
+ assert.deepEqual({ value: 'jupiter', expanded: false }, actual);
147
+ });
148
149
0 commit comments