Skip to content

Latest commit

 

History

History
38 lines (27 loc) · 1.14 KB

README.md

File metadata and controls

38 lines (27 loc) · 1.14 KB

antd-enzyme

Build Status

Enzyme enhancement for Ant Design components.

Basic Usage

import test from 'ava'
import sinon from 'sinon'
import 'antd-enzyme'
import { mount } from 'enzyme'
import React from 'react'

test('app', t => {
  const handleChange = sinon.spy()
  const wrapper = mount(<SelectForm handleChange={handleChange} />)

  // Find antd's Select component which has a prop name="color"
  const select = wrapper.antd().find('Select', { name: 'color' })

  select.simulate('change', { target: { value: 'green' } })

  t.is(handleChange.firstCall.args[0], 'green')
})

Supported components