home-section-menu.spec.ts 963 B

123456789101112131415161718192021222324252627282930313233
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. import { visitView } from '#tests/support/components/visitView.ts'
  3. import { mockPermissions } from '#tests/support/mock-permissions.ts'
  4. import { mockTicketOverviews } from '#tests/support/mocks/ticket-overviews.ts'
  5. describe('testing home section menu', () => {
  6. beforeEach(() => {
  7. mockTicketOverviews()
  8. })
  9. it('not show ticket overview section menu item without permission', async () => {
  10. const view = await visitView('/')
  11. expect(
  12. view.queryByRole('link', {
  13. name: 'Ticket Overviews',
  14. }),
  15. ).not.toBeInTheDocument()
  16. })
  17. it('show ticket overview section menu item', async () => {
  18. mockPermissions(['ticket.agent'])
  19. const view = await visitView('/')
  20. const ticketOverviewLink = view.getByRole('link', {
  21. name: 'Ticket Overviews',
  22. })
  23. expect(ticketOverviewLink).toHaveAttribute('href', '/mobile/tickets/view')
  24. })
  25. })