home-quick-action.spec.ts 828 B

123456789101112131415161718192021222324252627
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. import { waitFor } from '@testing-library/vue'
  3. import { visitView } from '#tests/support/components/visitView.ts'
  4. import { mockPermissions } from '#tests/support/mock-permissions.ts'
  5. import { mockTicketOverviews } from '#tests/support/mocks/ticket-overviews.ts'
  6. describe('testing quick action', () => {
  7. beforeEach(() => {
  8. mockTicketOverviews()
  9. })
  10. it('ticket create quick action is present', async () => {
  11. mockPermissions(['ticket.agent'])
  12. const view = await visitView('/')
  13. expect(view.getByLabelText('Create new ticket')).toBeInTheDocument()
  14. await view.events.click(view.getByLabelText('Create new ticket'))
  15. await waitFor(() => {
  16. expect(view.queryByText('Create Ticket')).toBeInTheDocument()
  17. })
  18. })
  19. })