Skip to content

Commit

Permalink
Merge 1d589c4 into de1c838
Browse files Browse the repository at this point in the history
  • Loading branch information
kYem committed Jun 11, 2020
2 parents de1c838 + 1d589c4 commit f99bb45
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions __snapshots__/src/index.test.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ Generated by [AVA](https://ava.li).
id="rdts"
inlineSearchInput={false}
mode="radioSelect"
onAction={Function onAction {}}
onBlur={Function onBlur {}}
onChange={Function onChange {}}
onFocus={Function onFocus {}}
Expand Down Expand Up @@ -609,6 +610,7 @@ Generated by [AVA](https://ava.li).
}
id="rdts"
inlineSearchInput={false}
onAction={Function onAction {}}
onBlur={Function onBlur {}}
onChange={Function onChange {}}
onFocus={Function onFocus {}}
Expand Down
Binary file modified __snapshots__/src/index.test.js.snap
Binary file not shown.
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class DropdownTreeSelect extends Component {
}

static defaultProps = {
onAction: () => {},
onFocus: () => {},
onBlur: () => {},
onChange: () => {},
Expand Down
7 changes: 7 additions & 0 deletions src/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,13 @@ test('notifies on action', t => {
t.true(handler.calledWithExactly(node0, action))
})

test('notifies on action without onAction handler', t => {
const { tree } = t.context
const wrapper = mount(<DropdownTreeSelect id={dropdownId} data={tree} showDropdown="initial" />)
wrapper.find('i.fa-ban').simulate('click')
t.pass()
})

test('notifies on node toggle', t => {
const handler = spy()
const { tree } = t.context
Expand Down

0 comments on commit f99bb45

Please sign in to comment.