InviteesTable.test.tsx 743 B

1234567891011121314151617181920212223242526272829303132
  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. revokeInvite: jest.fn(),
  10. };
  11. Object.assign(props, propOverrides);
  12. return shallow(<InviteesTable {...props} />);
  13. };
  14. describe('Render', () => {
  15. it('should render component', () => {
  16. const wrapper = setup();
  17. expect(wrapper).toMatchSnapshot();
  18. });
  19. it('should render invitees', () => {
  20. const wrapper = setup({
  21. invitees: getMockInvitees(5),
  22. });
  23. expect(wrapper).toMatchSnapshot();
  24. });
  25. });