Browse Source

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

Mantas 4 years ago
parent
commit
bb26438c1c

+ 2 - 0
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)

+ 4 - 0
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

+ 21 - 0
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