import * as React from 'react' import { mount, ReactWrapper } from 'enzyme' import { ToggleButtonGroup } from '../index' import { RadioInput } from '../styles' const OPTIONS = [ { value: 'x', label: 'Hello' }, { value: 'x2', label: 'LOL' }, { value: 'x3', label: 'Revolut' }, ] describe('ToggleButtonGroup', () => { let buttonGroup: ReactWrapper const onChange = jest.fn() beforeAll(() => { buttonGroup = mount( , ) }) beforeEach(() => jest.clearAllMocks()) it('select value thought props', () => { buttonGroup.setProps({ value: OPTIONS[1].value, }) expect( buttonGroup.find(RadioInput).find('[checked=true]').first().parent().props().title, ).toBe(OPTIONS[1].label) }) })