The events are very common in any web application and we need to test them as well, so let's learn how to test events. For this, let's create a new ShowInformation component:
import React, { Component } from 'react';
class ShowInformation extends Component {
state = {
name: '',
age: 0,
show: false
};
handleOnChange = ({ target: { value, name } }) => {
this.setState({
[name]: value
});
}
handleShowInformation = () => {
this.setState({
show: true
});
}
render() {
if (this.state.show) {
return (
<div className="ShowInformation">
<h1>Personal Information</h1>
<div className="personalInformation">
<p><strong>Name:</strong> {this.state.name}<...