Skip to content

Instantly share code, notes, and snippets.

@eyaleizenberg
Created June 11, 2019 05:07
Show Gist options
  • Save eyaleizenberg/07899e25fb8549adf8a7f713ae22c401 to your computer and use it in GitHub Desktop.
Save eyaleizenberg/07899e25fb8549adf8a7f713ae22c401 to your computer and use it in GitHub Desktop.
import { HelloPerson } from './hello-person.component';
import { shallow } from 'enzyme';
describe('Hello Person', () => {
test('should render the name from the prop', () => {
const props = {
name: 'Jenia'
};
const wrapper = shallow<HelloPerson>(<HelloPerson {...props} />);
const renderedName = wrapper.find('#name').text();
expect(renderedName).toBe('Jenia');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment