I have the following code:
class Dummy extends React.Component {
constructor(props) {
this.state = { field: '' }
}
componentDidMount() {
PubSub.subscribe('event', () => {
this.setState({ field: 'a' });
});
}
}
I want to make sure that when I Publish event, the state is set to a. How do I achieve this using Jest with Enzyme?