From 4a70ba3e3b49fb9c6fec369c124cfa722566c23e Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Sat, 21 Feb 2015 00:17:49 +0100 Subject: [PATCH] Added browser tests for overview. --- .../app/controllers/ticket_overview.js.coffee | 1 + .../app/controllers/ticket_zoom.js.coffee | 8 +- .../app/lib/app_post/task_manager.js.coffee | 4 + .../javascripts/app/views/ticket_zoom.jst.eco | 1 + .../ticket_zoom/overview_navigator.jst.eco | 3 +- app/assets/stylesheets/zammad.css.scss | 7 +- .../agent_ticket_overview_level1_test.rb | 87 +++++++++++++++++++ test/browser_test_helper.rb | 68 +++++++++++++++ 8 files changed, 175 insertions(+), 4 deletions(-) create mode 100644 test/browser/agent_ticket_overview_level1_test.rb diff --git a/app/assets/javascripts/app/controllers/ticket_overview.js.coffee b/app/assets/javascripts/app/controllers/ticket_overview.js.coffee index de9f03134..6ab189285 100644 --- a/app/assets/javascripts/app/controllers/ticket_overview.js.coffee +++ b/app/assets/javascripts/app/controllers/ticket_overview.js.coffee @@ -92,6 +92,7 @@ class Table extends App.Controller # remeber bulk attributes @bulk = data.bulk + # fill cache @cache[data.view] = data # check if current view is updated diff --git a/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee b/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee index 9844ecb52..54dbaae29 100644 --- a/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee +++ b/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee @@ -852,12 +852,18 @@ class OverviewNavigator extends App.Controller open: (e) => e.preventDefault() + + # get requested object and location id = $(e.target).data('id') url = $(e.target).attr('href') if !id id = $(e.target).closest('a').data('id') url = $(e.target).closest('a').attr('href') - console.log('id', id, 'url', url) + + # return if we are unable to get id + return if !id + + # open task via task manager to get overview information App.TaskManager.execute( key: 'Ticket-' + id controller: 'TicketZoom' diff --git a/app/assets/javascripts/app/lib/app_post/task_manager.js.coffee b/app/assets/javascripts/app/lib/app_post/task_manager.js.coffee index 557082300..df2e057ef 100644 --- a/app/assets/javascripts/app/lib/app_post/task_manager.js.coffee +++ b/app/assets/javascripts/app/lib/app_post/task_manager.js.coffee @@ -124,6 +124,10 @@ class _taskManagerSingleton extends Spine.Module # input validation params.key = App.Utils.htmlAttributeCleanup(params.key) + # if we have init task startups, let the controller know this + if params.init + params.params.init = true + # in case an init execute arrives later but is aleady executed, ignore it if params.init && @workers[ params.key ] #console.log('IGNORE LATER INIT', params) diff --git a/app/assets/javascripts/app/views/ticket_zoom.jst.eco b/app/assets/javascripts/app/views/ticket_zoom.jst.eco index f37bfa1a9..f0e79f546 100644 --- a/app/assets/javascripts/app/views/ticket_zoom.jst.eco +++ b/app/assets/javascripts/app/views/ticket_zoom.jst.eco @@ -6,6 +6,7 @@
+