Skip to content

Instantly share code, notes, and snippets.

@radzserg
Created July 10, 2019 09:26
Show Gist options
  • Select an option

  • Save radzserg/f3f10b1958321a9fa8add9ad027368cc to your computer and use it in GitHub Desktop.

Select an option

Save radzserg/f3f10b1958321a9fa8add9ad027368cc to your computer and use it in GitHub Desktop.
@withRouter()
class HomePage extends PureComponent<RouteComponentProps> {
render() {
return (
<a onClick={this.props.history.push("/catalog")}>Catalog</a>
);
}
}
// now I wanna make a snapshot testing
it("renders home page", () => {
const page = mount(
{/* Not it does not reder it! without... <BrowserRouter> */}
<HomePage/>
);
expect(page).toMatchSnapshot();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment