agent_ticket_task_changed_test.rb 1.3 KB

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