Skip to content

tjaniczek/antd-enzyme

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

[DEPRECATED]

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%