popover_spec.rb 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.describe 'Popover', type: :system do
  4. # This test covers generic PopoverProvidable behavior
  5. it 'opening & auto-closing' do
  6. visit "#ticket/zoom/#{Ticket.first.id}"
  7. within :active_content do
  8. find('.ticketZoom-header .js-avatar').hover
  9. end
  10. # popover opened up
  11. expect(page).to have_css('.popover')
  12. visit '#dashboard'
  13. # move mouse to another location
  14. # for reliable popover re-spawning
  15. find('.menu').hover
  16. # popover is not visible when moving to another page without moving mouse
  17. # https://github.com/zammad/zammad/issues/4058
  18. expect(page).to have_no_css('.popover')
  19. visit "#ticket/zoom/#{Ticket.first.id}"
  20. # popover is not visible when moving back to the original page without moving mouse
  21. expect(page).to have_no_css('.popover')
  22. within :active_content do
  23. find('.ticketZoom-header .js-avatar').hover
  24. end
  25. # popover opens up again
  26. expect(page).to have_css('.popover')
  27. end
  28. end