import React from 'react' import { mount, shallow } from 'enzyme' import { CrossIcon } from '../icon/crossIcon' import { Loader } from '../loader/Loader' import { ItemAction } from '.' jest.useFakeTimers() const defaultProps = { className: 'custom', action: 'Action', subLabel: 'sub label', leftAddon: , href: '#', onClick() {}, onBlur() {}, onFocus() {}, onMouseDown() {}, } describe('ItemAction', () => { it('Should forward props to Item', () => { const wrapper = shallow() expect(wrapper.prop('className')).toEqual('custom') expect(wrapper.prop('leftTitle')).toEqual('Action') expect(wrapper.prop('leftBody')).toEqual('sub label') expect(wrapper.prop('leftAddon')).toEqual() expect(wrapper.prop('href')).toEqual('#') expect(wrapper.prop('onClick')).not.toBeNull() expect(wrapper.prop('onBlur')).not.toBeNull() expect(wrapper.prop('onFocus')).not.toBeNull() expect(wrapper.prop('onMouseDown')).not.toBeNull() }) it('Should set highlighted to true', () => { const wrapper = shallow() expect(wrapper.prop('highlighted')).toBe(true) }) it('Should set tag to button by default', () => { const wrapper = shallow() // eslint-disable-next-line react/button-has-type expect(wrapper.prop('tag')).toEqual(