diff --git a/src/__tests__/DropdownItem.spec.js b/src/__tests__/DropdownItem.spec.js index 6ecff64ff..d8f5da601 100644 --- a/src/__tests__/DropdownItem.spec.js +++ b/src/__tests__/DropdownItem.spec.js @@ -144,6 +144,23 @@ describe('DropdownItem', () => { expect(onClick).toHaveBeenCalled(); }); + it('should call onClick prop', () => { + toggle = jest.fn(); + const clickHandler = jest.fn(); + const wrapper = mount( + Click me, + { + context: { + toggle: toggle + } + } + ); + + wrapper.simulate('click'); + expect(clickHandler).toHaveBeenCalled(); + expect(toggle).toHaveBeenCalled(); + }); + it('should call toggle', () => { toggle = jest.fn(); const wrapper = mount(