From 116606416ccbbc1fb3833ca3b37e8fb42747a83c Mon Sep 17 00:00:00 2001 From: Mantas Masalskis Date: Wed, 19 Feb 2020 12:56:27 +0100 Subject: [PATCH] Fixes #2918 - Editing of KB article not possible if long text is pasted. --- app/assets/stylesheets/zammad.scss | 4 ++++ .../knowledge_base/locale/answer/edit_spec.rb | 22 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 spec/system/knowledge_base/locale/answer/edit_spec.rb diff --git a/app/assets/stylesheets/zammad.scss b/app/assets/stylesheets/zammad.scss index 5b2fa1de9..0206c9424 100644 --- a/app/assets/stylesheets/zammad.scss +++ b/app/assets/stylesheets/zammad.scss @@ -11251,6 +11251,10 @@ span.is-disabled { form { flex-shrink: 0; } + + .richtext-content { + word-break: break-all; + } .page-header { margin: 1px 0 3px; diff --git a/spec/system/knowledge_base/locale/answer/edit_spec.rb b/spec/system/knowledge_base/locale/answer/edit_spec.rb new file mode 100644 index 000000000..5a8d874d3 --- /dev/null +++ b/spec/system/knowledge_base/locale/answer/edit_spec.rb @@ -0,0 +1,22 @@ +require 'rails_helper' + +RSpec.describe 'Knowledge Base Locale Answer Edit', type: :system, authenticated: true do + include_context 'basic Knowledge Base' + + before do + published_answer && draft_answer && internal_answer + end + + it 'when entering a long text' do + long_string = '3KKFA9DAWE9VJYNNnpYRRtMwfa168O1yvpD2t9QXsfb3cppGV6KZ12q0UUJIy5r4Exfk18GnWPR0A3SoDsjxIHz1Gcu4aCEVzenilSOu4gAfxnB6k3mSBUOGIfdgChEBYhcHGgiCmV2EoXu4gG7GAJxKJhM2d4NUiL5RZttGtMXYYFr2Jsg7MV7xXGcygnsLMYqnwzOJxBK0vH3fzhdIZd6YrqR3fggaY0RyKtVigOBZ2SETC8s238Z9eDL4gfUW' + + visit "#knowledge_base/#{knowledge_base.id}/locale/#{primary_locale.system_locale.locale}/answer/#{draft_answer.id}/edit" + + within(:active_content) do + find('.richtext-content').send_keys long_string + + expect(page).to have_css('.js-submit') { |elem| !elem.obscured? } + expect(page).to have_css('.page-header-title') { |elem| !elem.obscured? } + end + end +end