antd-enzyme

enzyme enhancement for Ant Design components


Keywords
react, enzyme, ant-design, antd
License
MIT
Install
npm install antd-enzyme@0.0.1

Documentation

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