It can be a bug or a feature request, depends on the way you look at it :stuck_out_tongue:
For some reason t.typeText() is not triggering the onChange handler within a text input element.
t.typeText() should trigger onChange event when typing each character so we can react on it.
onChange propconsole.log() in the handlerTest code
Component:
class LoginForm extends PureComponent {
constructor(props) {
super(props);
this.state = {
email: ''
};
this.handleEmailChange = this.handleEmailChange.bind(this);
}
handleEmailChange({ target }) {
console.log(target.value);
this.setState({ email: target.value });
}
render() {
return (
<input
id="loginField"
type="text"
value={this.state.value}
onChange={this.handleEmailChange}
/>
);
}
}
Test
test('Should be able to type into login input', async (t) => {
await t
// Will show as if it's working, but nothing will be logged in the console
.typeText(loginField, 'This will not be logged')
// Although this will pass
.expect(loginField.value, 'This will not be logged');
// So you can can open console and see output
await t.wait(1000000);
});
Hi @m4n3z40,
We've reproduced the issue and will investigate it.
Thank you for your assistance. We have found a problem that persists since version 15.6.0 of the聽react-dom聽package. We will fix it ASAP.
I can confirm that with the version 0.16.2 this works fine.
Awesome. Thanks Team.
Really good work.
Thanks! =)
This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow.
Most helpful comment
I can confirm that with the version
0.16.2this works fine.