disabledMemberTooltip.spec.tsx 934 B

123456789101112131415161718192021222324252627
  1. import {OrganizationFixture} from 'sentry-fixture/organization';
  2. import {SubscriptionFixture} from 'getsentry-test/fixtures/subscription';
  3. import {render, screen, userEvent} from 'sentry-test/reactTestingLibrary';
  4. import DisabledMemberTooltip from 'getsentry/hooks/disabledMemberTooltip';
  5. import SubscriptionStore from 'getsentry/stores/subscriptionStore';
  6. describe('MemberListHeader', function () {
  7. const organization = OrganizationFixture();
  8. const sub = SubscriptionFixture({
  9. organization,
  10. canTrial: false,
  11. isTrial: false,
  12. plan: 'am1_f',
  13. });
  14. SubscriptionStore.set(organization.slug, sub);
  15. it('render basic', async function () {
  16. render(<DisabledMemberTooltip>Inner text</DisabledMemberTooltip>);
  17. // Activate the tooltip, check its contents.
  18. await userEvent.hover(screen.getByText('Inner text'));
  19. expect(await screen.findByText(/Only 1 member allowed/i)).toBeInTheDocument();
  20. });
  21. });