Skip to content

Instantly share code, notes, and snippets.

@tsh-code
Created April 9, 2019 06:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsh-code/2a49a93244138ab27f6ee506c38f7d34 to your computer and use it in GitHub Desktop.
Save tsh-code/2a49a93244138ab27f6ee506c38f7d34 to your computer and use it in GitHub Desktop.
import React from 'react';
import { render } from 'enzyme';
import { UsersList } from './users-list.component';
const data = [
{
id: '5c76f0b7bb5c210da0f8554a',
firstName: 'Florine',
lastName: 'Russell',
email: 'florine.russell$email..org',
},
];
jest.mock('./row/users-list-row.component', () => ({
UsersListRow: props => <li>{JSON.stringify(props, null, 2)}</li>,
}));
describe('Users list component', () => {
it('renders list with 1 row', () => {
const wrapper = render(<UsersList users={data} />);
expect(wrapper).toMatchSnapshot();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment