InviteesTable.test.tsx 714 B

12345678910111213141516171819202122232425262728293031
  1. import React from 'react';
  2. import { shallow } from 'enzyme';
  3. import InviteesTable, { Props } from './InviteesTable';
  4. import { Invitee } from 'app/types';
  5. import { getMockInvitees } from './__mocks__/userMocks';
  6. const setup = (propOverrides?: object) => {
  7. const props: Props = {
  8. invitees: [] as Invitee[],
  9. };
  10. Object.assign(props, propOverrides);
  11. return shallow(<InviteesTable {...props} />);
  12. };
  13. describe('Render', () => {
  14. it('should render component', () => {
  15. const wrapper = setup();
  16. expect(wrapper).toMatchSnapshot();
  17. });
  18. it('should render invitees', () => {
  19. const wrapper = setup({
  20. invitees: getMockInvitees(5),
  21. });
  22. expect(wrapper).toMatchSnapshot();
  23. });
  24. });