Fixes #3260 - "Next in overview" doesn't update the URL

This commit is contained in:
Mantas 2020-11-11 11:58:06 +02:00 committed by Thorsten Eckel
parent 68fb6bc541
commit bb26438c1c
3 changed files with 27 additions and 0 deletions

View file

@ -32,6 +32,8 @@ App.TicketNavigable =
if nextTicket if nextTicket
@taskCloseTicket() @taskCloseTicket()
@taskLoadTicket(nextTicket.id) @taskLoadTicket(nextTicket.id)
@navigate "#ticket/zoom/#{nextTicket.id}"
return return
@taskCloseTicket(true) @taskCloseTicket(true)

View file

@ -43,3 +43,7 @@ end
Capybara.add_selector(:link_containing) do Capybara.add_selector(:link_containing) do
xpath { |text| ".//a//*[text()[contains(.,\"#{text}\")]]" } xpath { |text| ".//a//*[text()[contains(.,\"#{text}\")]]" }
end end
Capybara.add_selector(:element_containing) do
xpath { |text| ".//*[text()[contains(.,\"#{text}\")]]" }
end

View file

@ -1093,4 +1093,25 @@ RSpec.describe 'Ticket zoom', type: :system do
end end
end 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 end