managed-user-cannot-join.test.tsx 839 B

123456789101112131415161718192021
  1. import { render, screen } from '@testing-library/react'
  2. import ManagedUserCannotJoin from '../../../../../../frontend/js/features/subscription/components/group-invite/managed-user-cannot-join'
  3. describe('ManagedUserCannotJoin', function () {
  4. beforeEach(function () {
  5. window.metaAttributesCache.set(
  6. 'ol-currentManagedUserAdminEmail',
  7. 'example@overleaf.com'
  8. )
  9. window.metaAttributesCache.set('ol-cannot-join-subscription', true)
  10. })
  11. it('renders the component', async function () {
  12. render(<ManagedUserCannotJoin />)
  13. await screen.findByText(
  14. 'Your Overleaf account is managed by your current group admin (example@overleaf.com). This means you can’t join additional group subscriptions',
  15. { exact: false }
  16. )
  17. screen.getByRole('link', { name: 'Read more about Managed Users.' })
  18. })
  19. })