Skip to content

Instantly share code, notes, and snippets.

@tsh-code
Created April 9, 2019 06:14
Show Gist options
  • Save tsh-code/47099039bd49ad98a50546342d1125d4 to your computer and use it in GitHub Desktop.
Save tsh-code/47099039bd49ad98a50546342d1125d4 to your computer and use it in GitHub Desktop.
import React from 'react';
import { render } from 'enzyme';
import { UsersListRow } from './users-list-row.component';
const data = [
{
id: '5c76f0b7bb5c210da0f8554a',
firstName: 'Florine',
lastName: 'Russell',
email: 'florine.russell$email..org',
},
];
describe('Users list row component', () => {
it('renders row with full user data', () => {
const wrapper = render(<UsersListRow user={data[0]} />);
expect(wrapper).toMatchSnapshot();
});
it('renders row with placeholder for email', () => {
const { email, ...user } = data[0];
const wrapper = render(<UsersListRow user={user} />);
expect(wrapper).toMatchSnapshot();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment