From 0f884b53428383fa66f7c5cabf3ceccf59acc929 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Wed, 7 Mar 2018 22:58:03 +0100 Subject: [PATCH] Improved new "one" click to ticket create screen feature. Allow relogin without permanent changes to navigation registration. --- .../app/controllers/navigation.coffee | 2 +- test/browser/customer_ticket_create_test.rb | 61 +++++++++++++++++++ 2 files changed, 62 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/app/controllers/navigation.coffee b/app/assets/javascripts/app/controllers/navigation.coffee index db6b0ed86..e9f88670e 100644 --- a/app/assets/javascripts/app/controllers/navigation.coffee +++ b/app/assets/javascripts/app/controllers/navigation.coffee @@ -128,7 +128,7 @@ class App.Navigation extends App.ControllerWidgetPermanent renderPersonal: => @recentViewNavbarItemsRebuild() - items = @getItems(navbar: @Config.get('NavBarRight')) + items = clone(@getItems(navbar: @Config.get('NavBarRight')), true) # if only one child exists, use direct access for item in items diff --git a/test/browser/customer_ticket_create_test.rb b/test/browser/customer_ticket_create_test.rb index 79f8e1c8c..980cf5048 100644 --- a/test/browser/customer_ticket_create_test.rb +++ b/test/browser/customer_ticket_create_test.rb @@ -152,4 +152,65 @@ class CustomerTicketCreateTest < TestCase value: 'open', ) end + + def test_customer_ticket_create_relogin_with_agent_ticket_crearte + @browser = browser_instance + login( + username: 'nicole.braun@zammad.org', + password: 'test', + url: browser_url, + ) + + # customer ticket create + click(css: 'a[href="#new"]', only_if_exists: true) + click(css: 'a[href="#customer_ticket_new"]') + sleep 2 + + select( + css: '.newTicket select[name="group_id"]', + value: 'Users', + ) + + set( + css: '.newTicket input[name="title"]', + value: 'relogin - customer - agent - test 1', + ) + set( + css: '.newTicket [data-name="body"]', + value: 'relogin - customer - agent - test 1', + ) + + click(css: '.newTicket button.js-submit') + sleep 5 + + # check if ticket is shown + location_check(url: '#ticket/zoom/') + + match( + css: '.active div.ticket-article', + value: 'relogin - customer - agent - test 1', + no_quote: true, + ) + + logout() + + # verify if we still can create new tickets as agent + login( + username: 'master@example.com', + password: 'test', + url: browser_url, + ) + tasks_close_all() + + ticket1 = ticket_create( + data: { + customer: 'nico', + group: 'Users', + title: 'relogin - customer - agent - test 2', + body: 'relogin - customer - agent - test 2', + state: 'closed', + }, + ) + end + end