request-status.spec.tsx 1.1 KB

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