Skip to content

Commit

Permalink
fix(Dropdown): update after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Fedyashov committed Jun 15, 2017
1 parent 10e8a06 commit 6076075
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
6 changes: 0 additions & 6 deletions test/specs/modules/Dropdown/Dropdown-test.js
Expand Up @@ -1533,12 +1533,6 @@ describe('Dropdown', () => {
.should.have.exactly(1).descendants(DropdownSearchInput)
})

it('adds the name prop to the search input', () => {
wrapperShallow(<Dropdown name='foo' options={options} selection search />)
.find(DropdownSearchInput)
.should.have.prop('name', 'foo')
})

it('sets focus to the search input on open', () => {
wrapperMount(<Dropdown options={options} selection search />)
.simulate('click')
Expand Down
15 changes: 3 additions & 12 deletions test/specs/modules/Dropdown/DropdownSearchInput-test.js
Expand Up @@ -23,26 +23,17 @@ describe('DropdownSearchInput', () => {
})
})

describe('name', () => {
it('appends name with "-search"', () => {
const name = faker.random.word()

shallow(<DropdownSearchInput name={name} />)
.should.have.attr('name', `${name}-search`)
})
})

describe('onChange', () => {
it('is called with (e, data) on change', () => {
const onChange = sandbox.spy()
const e = { target: { value: 'name' } }
const e = { target: { value: 'value' } }

shallow(<DropdownSearchInput onChange={onChange} name='foo' />)
shallow(<DropdownSearchInput onChange={onChange} />)
.find('input')
.simulate('change', e)

onChange.should.have.been.calledOnce()
onChange.should.have.been.calledWithMatch(e, { name: 'foo', value: e.target.value })
onChange.should.have.been.calledWithMatch(e, { value: e.target.value })
})
})

Expand Down

0 comments on commit 6076075

Please sign in to comment.