Skip to content

Instantly share code, notes, and snippets.

@tiagogomes772
Created October 28, 2018 11:54
Show Gist options
  • Save tiagogomes772/acd027f9323560a72e9d8b007b9c3cb4 to your computer and use it in GitHub Desktop.
Save tiagogomes772/acd027f9323560a72e9d8b007b9c3cb4 to your computer and use it in GitHub Desktop.
it('renders random advice', () => {
const app = shallow(<App advice='Random Advice' fetching={false} />);
console.log("HERE", app.debug());
expect(app.instance().defineLabelAdvice()).toEqual('This is a random advice');
expect(app).toMatchSnapshot();
});
it('renders input based advice', () => {
const app = shallow(<App advice='Input Advice' fetching={false} />);
app.setState({ value: 'spider' });
console.log("HERE", app.debug());
expect(app.instance().defineLabelAdvice()).toEqual('This is a advice based on the input:');
expect(app).toMatchSnapshot();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment