InviteesTable.test.tsx 724 B

12345678910111213141516171819202122232425262728293031323334
  1. import { shallow } from 'enzyme';
  2. import React from 'react';
  3. import { Invitee } from 'app/types';
  4. import { getMockInvitees } from '../users/__mocks__/userMocks';
  5. import InviteesTable, { Props } from './InviteesTable';
  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. });