使用react的情况下,一般也会用到redux,那么对于这种在react中使用redux的情况,写测试的时候就不能只用之前的文章里面介绍的方式写了。来看下组件例子import React, { Component, findDOMNode } from 'react'
import { connect } from 'react-redux'
import { increase, decrease, fetchItems } from '../../actions/counter'
class Home extends Component {
render() {
const {
item,
number,
isFetching,
increase,
decrease,
fetchItems
} = this.props;
return (
Some state changes:
{number}
Item Length : {item.length}
Request Item State:{!isFetching ? '已完成' : '获取中'}
...
继续阅读
(219)