Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check correct commit phase props in fuzz tester #14129

Merged
merged 1 commit into from Nov 6, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -189,6 +189,7 @@ describe('ReactIncrementalTriangle', () => {
leafTriangles.push(this);
}
this.state = {isActive: false};
this.child = React.createRef(null);
}
activate() {
this.setState({isActive: true});
Expand All @@ -203,6 +204,14 @@ describe('ReactIncrementalTriangle', () => {
this.state.isActive !== nextState.isActive
);
}
componentDidUpdate() {
if (this.child.current !== null) {
const {prop: currentCounter} = JSON.parse(this.child.current.prop);
if (this.props.counter !== currentCounter) {
throw new Error('Incorrect props in lifecycle');
}
}
}
render() {
if (yieldAfterEachRender) {
ReactNoop.yield(this);
Expand All @@ -228,7 +237,7 @@ describe('ReactIncrementalTriangle', () => {
activeDepthProp,
activeDepthContext,
});
return <span prop={output} />;
return <span ref={this.child} prop={output} />;
}

return (
Expand Down