Browse Source

Fixes #4277 - Confirmation dialog after tag deletion does not close

Mantas 2 years ago
parent
commit
a9fcc6b626
2 changed files with 30 additions and 1 deletions
  1. 1 1
      app/assets/javascripts/app/controllers/tag.coffee
  2. 29 0
      spec/system/manage/tags_spec.rb

+ 1 - 1
app/assets/javascripts/app/controllers/tag.coffee

@@ -39,7 +39,7 @@ class Tag extends App.ControllerSubContent
       url:   "#{@apiPath}/tag_list"
       data:  JSON.stringify(name: name)
       success: (data, status, xhr) =>
-        field.val('')
+        @html App.view('tag/index')()
         new Table(
           el: @$('.js-Table')
         )

+ 29 - 0
spec/system/manage/tags_spec.rb

@@ -0,0 +1,29 @@
+# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
+
+require 'rails_helper'
+
+RSpec.describe 'Manage > Tags', type: :system do
+  before do
+    visit 'manage/tags'
+  end
+
+  let(:tag_name) { 'New Tag 123' }
+
+  # https://github.com/zammad/zammad/issues/4277
+  it 'removes a tag after adding a tag without double modal' do
+    within :active_content do
+      find('input[name="name"]').fill_in with: tag_name
+      click '.js-submit'
+    end
+
+    within '.js-Table tr', text: tag_name do
+      click '.btn--secondary'
+    end
+
+    in_modal do
+      click_on 'Yes'
+    end
+
+    expect(page).to have_no_css('.modal')
+  end
+end