我正在尝试测试一个组件 undecorator,但我没有得到。
例子:
import React, { Component } from 'react'
import { connect } from 'react-redux'
@connect(({ user }) => ({ user }))
export class Componente extends Component {
render () {
return <div>hello {this.props.user}</div>
}
}
示例测试:
import test from 'ava'
import Component from './Component'
import { mount } from 'enzyme'
test('<Component />', t => {
let wrapper = mount(<Component />) // the connect's redux create a wrapper component :(
})
可以测试未装饰的组件吗?如何?