request-status.spec.tsx 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import '../../../helpers/bootstrap-5'
  2. import RequestStatus from '@/features/group-management/components/request-status'
  3. describe('<RequestStatus />', function () {
  4. beforeEach(function () {
  5. cy.window().then(win => {
  6. win.metaAttributesCache.set('ol-groupName', 'My Awesome Team')
  7. })
  8. cy.mount(
  9. <RequestStatus icon="email" title="Test title" content="Test content" />
  10. )
  11. })
  12. it('renders the back button', function () {
  13. cy.findByTestId('group-heading').within(() => {
  14. cy.findByRole('button', { name: /back to subscription/i }).should(
  15. 'have.attr',
  16. 'href',
  17. '/user/subscription'
  18. )
  19. })
  20. })
  21. it('shows the group name', function () {
  22. cy.findByTestId('group-heading').within(() => {
  23. cy.findByRole('heading', { name: 'My Awesome Team' })
  24. })
  25. })
  26. it('shows the title', function () {
  27. cy.findByTestId('title').should('contain.text', 'Test title')
  28. })
  29. it('shows the content', function () {
  30. cy.findByText('Test content')
  31. })
  32. it('renders the link to subscriptions', function () {
  33. cy.findByRole('button', { name: /go to subscriptions/i }).should(
  34. 'have.attr',
  35. 'href',
  36. '/user/subscription'
  37. )
  38. })
  39. })