用酶模拟`变化`后,复选框未被‘选中’ 我尝试使用酶来模拟复选框上的change事件,并使用chai-enzyme来断言它是否被选中。 这是我的Hello反应组件: import React from 'react'; class Hello extends React.Component { constructor(props) { super(props); this.state = { .. 发布时间:2022-04-08 22:28:39 reactjs checkbox simulate enzyme chai-enzyme 其他开发
当函数作为prop传递时调用带有酶的函数-React 我有一个说 onClickOfCreateAccountButton 的函数,单击该函数后,我的子组件会调用它,但逻辑会写在父组件中。 我如何模拟它? 我的代码: onClickOfCreateAccountButton(){ const el = document.getElementsByClassName('SignInSlider-loginSlider')[0]; .. 发布时间:2020-10-30 04:46:18 reactjs testing enzyme chai-enzyme 其他开发