diff --git a/app/assets/javascripts/app/lib/mixins/ticket_navigable.coffee b/app/assets/javascripts/app/lib/mixins/ticket_navigable.coffee index e35f6ff6e..5eeba7cfd 100644 --- a/app/assets/javascripts/app/lib/mixins/ticket_navigable.coffee +++ b/app/assets/javascripts/app/lib/mixins/ticket_navigable.coffee @@ -32,6 +32,8 @@ App.TicketNavigable = if nextTicket @taskCloseTicket() @taskLoadTicket(nextTicket.id) + + @navigate "#ticket/zoom/#{nextTicket.id}" return @taskCloseTicket(true) diff --git a/spec/support/capybara/selectors.rb b/spec/support/capybara/selectors.rb index ba4dab2d5..343e6555e 100644 --- a/spec/support/capybara/selectors.rb +++ b/spec/support/capybara/selectors.rb @@ -43,3 +43,7 @@ end Capybara.add_selector(:link_containing) do xpath { |text| ".//a//*[text()[contains(.,\"#{text}\")]]" } end + +Capybara.add_selector(:element_containing) do + xpath { |text| ".//*[text()[contains(.,\"#{text}\")]]" } +end diff --git a/spec/system/ticket/zoom_spec.rb b/spec/system/ticket/zoom_spec.rb index abae6b014..1d13581c7 100644 --- a/spec/system/ticket/zoom_spec.rb +++ b/spec/system/ticket/zoom_spec.rb @@ -1093,4 +1093,25 @@ RSpec.describe 'Ticket zoom', type: :system do end end end + + # https://github.com/zammad/zammad/issues/3260 + describe 'next in overview macro changes URL', authenticated_as: :authenticate do + let(:ticket_a) { create(:ticket, title: 'ticket a', group: Group.first) } + let(:macro) { create(:macro, name: 'next macro', ux_flow_next_up: 'next_from_overview') } + + def authenticate + ticket_a && macro + + true + end + + it 'works' do + visit 'ticket/view/all_unassigned' + click_on 'Welcome to Zammad!' + click '.js-openDropdownMacro' + + expect { find(:element_containing, macro.name).click }.to change { current_url } + end + + end end