agent_ticket_task_changed_test.rb 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. require 'browser_test_helper'
  2. class AgentTicketTaskChangedTest < TestCase
  3. # regression test for issue #2042 - incorrect notification when closing a tab after setting up an object
  4. def test_detection_of_ticket_update_after_new_attribute
  5. @browser = browser_instance
  6. login(
  7. username: 'master@example.com',
  8. password: 'test',
  9. url: browser_url,
  10. )
  11. tasks_close_all()
  12. ticket_create(
  13. data: {
  14. customer: 'nico',
  15. group: 'Users',
  16. title: 'test ticket',
  17. body: 'some body 123äöü',
  18. },
  19. )
  20. object_manager_attribute_create(
  21. data: {
  22. name: 'text_test',
  23. display: 'text_test',
  24. data_type: 'Text',
  25. },
  26. )
  27. object_manager_attribute_migrate
  28. ticket_open_by_title(title: 'test ticket')
  29. # verify the 'Discard your changes' message does not appear (since there are no changes)
  30. assert_nil execute(js: "return $('.content.active .js-attributeBar .js-reset:not(\".hide\")').get(0)")
  31. tasks_close_all()
  32. sleep 0.5
  33. exists_not( css: '.modal')
  34. object_manager_attribute_delete(
  35. data: {
  36. name: 'text_test',
  37. },
  38. )
  39. object_manager_attribute_migrate
  40. end
  41. end