我正在尝试对这段代码进行单元测试:
onSearch = data => {
this.props.getFutureAgentDetail(data);
};
<Search
id="agent-search"
items={this.props.futureAgentData}
onItemAdd={this.addAgent}
itemKey={agent.searchKey}
getItems={this.onSearch}
clearMessage={this.props.clearMessage}
minLength={agent.minLength}
maxLength={agent.maxLength}
validation="^[a-zA-Z0-9]$"
duplicateMsg={this.props.duplicateAgent}
selectedItems={this.props.futureAgentTableData}
/>
我尝试使用sinon,但sinon无法识别ES6功能