diff --git a/public/app/core/components/OrgActionBar/OrgActionBar.test.tsx b/public/app/core/components/OrgActionBar/OrgActionBar.test.tsx index d1edeeaa779..6b4f7d24d30 100644 --- a/public/app/core/components/OrgActionBar/OrgActionBar.test.tsx +++ b/public/app/core/components/OrgActionBar/OrgActionBar.test.tsx @@ -5,7 +5,6 @@ import OrgActionBar, { Props } from './OrgActionBar'; const setup = (propOverrides?: object) => { const props: Props = { searchQuery: '', - showLayoutMode: true, setSearchQuery: jest.fn(), linkButton: { href: 'some/url', title: 'test' }, }; diff --git a/public/app/features/users/InviteesTable.test.tsx b/public/app/features/users/InviteesTable.test.tsx new file mode 100644 index 00000000000..9aae4d765b7 --- /dev/null +++ b/public/app/features/users/InviteesTable.test.tsx @@ -0,0 +1,32 @@ +import React from 'react'; +import { shallow } from 'enzyme'; +import InviteesTable, { Props } from './InviteesTable'; +import { Invitee } from 'app/types'; +import { getMockInvitees } from './__mocks__/userMocks'; + +const setup = (propOverrides?: object) => { + const props: Props = { + invitees: [] as Invitee[], + revokeInvite: jest.fn(), + }; + + Object.assign(props, propOverrides); + + return shallow(); +}; + +describe('Render', () => { + it('should render component', () => { + const wrapper = setup(); + + expect(wrapper).toMatchSnapshot(); + }); + + it('should render invitees', () => { + const wrapper = setup({ + invitees: getMockInvitees(5), + }); + + expect(wrapper).toMatchSnapshot(); + }); +}); diff --git a/public/app/features/users/InviteesTable.tsx b/public/app/features/users/InviteesTable.tsx index 82c02e607de..3157bf4fe38 100644 --- a/public/app/features/users/InviteesTable.tsx +++ b/public/app/features/users/InviteesTable.tsx @@ -7,10 +7,10 @@ export interface Props { } export default class InviteesTable extends PureComponent { - private copyRef = createRef(); + private copyUrlRef = createRef(); copyToClipboard = () => { - const node = this.copyRef.current; + const node = this.copyUrlRef.current; if (node) { node.select(); @@ -39,7 +39,12 @@ export default class InviteesTable extends PureComponent { {invitee.name}