I am learning jest, enzyme and i just cant figure out something so simple. My problem is that this condition is inside of another function. I need to check if the state obj is not null then assign some variables and test it. When I check code coverage it shows that the if statement is not covered. thanks
async handleButton() {
if (this.state.obj !== null) {
var employee = this.state.obj.employee.name;
var employeeId = this.state.obj.employee.id;
}
await this.setState({
updateObj: {...someOldObj, employee, employeeId};
});
}