Skip to content

Commit 4dba9e6

Browse files
committed
fix tests
1 parent 834a48b commit 4dba9e6

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

test/specs/modules/Dropdown/Dropdown-test.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ function dropdownInputIsFocused() {
8484
}
8585

8686
const dropdownMenuIsOpen = () => {
87-
wrapper.childAt(0).should.have.className('active')
88-
wrapper.childAt(0).should.have.className('visible')
87+
wrapper.should.have.className('active')
88+
wrapper.should.have.className('visible')
8989

9090
const menu = wrapper.find('DropdownMenu')
9191
try {
@@ -262,19 +262,19 @@ describe('Dropdown', () => {
262262
it('defaults to 0', () => {
263263
wrapperShallow(<Dropdown options={options} />)
264264

265-
wrapper.childAt(0).should.have.prop('tabIndex', 0)
265+
wrapper.should.have.prop('tabIndex', 0)
266266
})
267267

268268
it('defaults to -1 when disabled', () => {
269269
wrapperShallow(<Dropdown disabled options={options} />)
270270

271-
wrapper.childAt(0).should.have.prop('tabIndex', -1)
271+
wrapper.should.have.prop('tabIndex', -1)
272272
})
273273

274274
it('applies when defined', () => {
275275
wrapperShallow(<Dropdown options={options} tabIndex={1} />)
276276

277-
wrapper.childAt(0).should.have.prop('tabIndex', 1)
277+
wrapper.should.have.prop('tabIndex', 1)
278278
})
279279

280280
describe('tabIndex', () => {
@@ -435,7 +435,7 @@ describe('Dropdown', () => {
435435
const event = { foo: 'bar' }
436436

437437
wrapperShallow(<Dropdown onBlur={onBlur} />)
438-
wrapper.childAt(0).simulate('blur', event)
438+
wrapper.simulate('blur', event)
439439

440440
onBlur.should.have.been.calledOnce()
441441
onBlur.should.have.been.calledWithMatch(event)
@@ -445,12 +445,12 @@ describe('Dropdown', () => {
445445
wrapperShallow(<Dropdown selectOnBlur options={options} />)
446446

447447
const instance = wrapper.instance()
448-
wrapper.childAt(0).simulate('click', { stopPropagation: _.noop })
448+
wrapper.simulate('click', { stopPropagation: _.noop })
449449
dropdownMenuIsOpen()
450450
sandbox.spy(instance, 'handleChange')
451451

452452
const event = { stopPropagation: _.noop }
453-
wrapper.childAt(0).simulate('blur', event)
453+
wrapper.simulate('blur', event)
454454

455455
instance.handleChange.should.have.been.calledWithMatch(event, options[0].value)
456456
})
@@ -478,7 +478,7 @@ describe('Dropdown', () => {
478478
it('sets searchQuery state to empty', () => {
479479
wrapperMount(<Dropdown defaultSearchQuery='foo' search />)
480480

481-
wrapper.childAt(0).simulate('blur')
481+
wrapper.simulate('blur')
482482
wrapper.find('input.search').should.have.value('')
483483
})
484484

0 commit comments

Comments
 (0)