|
@@ -79,6 +79,24 @@ class AgentTicketEmailReplyKeepBodyTest < TestCase
|
|
|
|
|
|
end
|
|
|
|
|
|
+ def change_quote_config(params = {})
|
|
|
+ scroll_to(
|
|
|
+ position: 'botton',
|
|
|
+ css: '.content.active .js-settingContainer .js-setting',
|
|
|
+ )
|
|
|
+ click(css: '.content.active .js-settingContainer .js-setting')
|
|
|
+ modal_ready()
|
|
|
+ select(
|
|
|
+ css: params[:css],
|
|
|
+ value: params[:value]
|
|
|
+ )
|
|
|
+ click(
|
|
|
+ css: params[:submit_css],
|
|
|
+ )
|
|
|
+ modal_close()
|
|
|
+ modal_disappear()
|
|
|
+ end
|
|
|
+
|
|
|
def test_full_quote
|
|
|
@browser = instance = browser_instance
|
|
|
login(
|
|
@@ -96,30 +114,21 @@ class AgentTicketEmailReplyKeepBodyTest < TestCase
|
|
|
)
|
|
|
|
|
|
# enable email full quote in the ticket zoom config page
|
|
|
- scroll_to(
|
|
|
- position: 'botton',
|
|
|
- css: '.content.active .js-settingContainer .js-setting .dropdown-icon',
|
|
|
- )
|
|
|
- click(css: '.content.active .js-settingContainer .js-setting .dropdown-icon')
|
|
|
- modal_ready()
|
|
|
- select(
|
|
|
+ change_quote_config(
|
|
|
css: '.modal #ui_ticket_zoom_article_email_full_quote select[name="ui_ticket_zoom_article_email_full_quote"]',
|
|
|
- value: 'yes'
|
|
|
+ value: 'yes',
|
|
|
+ submit_css: '.modal #ui_ticket_zoom_article_email_full_quote .btn[type="submit"]',
|
|
|
)
|
|
|
- click(
|
|
|
- css: '.modal #ui_ticket_zoom_article_email_full_quote .btn[type="submit"]',
|
|
|
+ change_quote_config(
|
|
|
+ css: '.modal #ui_ticket_zoom_article_email_full_quote_header select[name="ui_ticket_zoom_article_email_full_quote_header"]',
|
|
|
+ value: 'yes',
|
|
|
+ submit_css: '.modal #ui_ticket_zoom_article_email_full_quote_header .btn[type="submit"]',
|
|
|
)
|
|
|
- modal_close()
|
|
|
- modal_disappear()
|
|
|
-
|
|
|
- exists(css: '.content.active .ticket-article [data-type="emailReply"]')
|
|
|
|
|
|
- # scroll to reply - needed for chrome
|
|
|
scroll_to(
|
|
|
position: 'botton',
|
|
|
css: '.content.active .ticket-article [data-type="emailReply"]',
|
|
|
)
|
|
|
-
|
|
|
click(css: '.content.active .ticket-article [data-type="emailReply"]')
|
|
|
|
|
|
full_text = @browser.find_element(css: '.content.active .article-new .articleNewEdit-body').text
|
|
@@ -128,6 +137,39 @@ class AgentTicketEmailReplyKeepBodyTest < TestCase
|
|
|
assert match
|
|
|
assert match[1]
|
|
|
assert Time.zone.parse(match[1])
|
|
|
+
|
|
|
+ # try again, but with the full quote header disabled
|
|
|
+ tasks_close_all()
|
|
|
+ ticket_open_by_title(
|
|
|
+ title: 'Welcome to Zammad',
|
|
|
+ )
|
|
|
+ change_quote_config(
|
|
|
+ css: '.modal #ui_ticket_zoom_article_email_full_quote_header select[name="ui_ticket_zoom_article_email_full_quote_header"]',
|
|
|
+ value: 'no',
|
|
|
+ submit_css: '.modal #ui_ticket_zoom_article_email_full_quote_header .btn[type="submit"]',
|
|
|
+ )
|
|
|
+
|
|
|
+ scroll_to(
|
|
|
+ position: 'botton',
|
|
|
+ css: '.content.active .ticket-article [data-type="emailReply"]',
|
|
|
+ )
|
|
|
+ click(css: '.content.active .ticket-article [data-type="emailReply"]')
|
|
|
+
|
|
|
+ full_text = @browser.find_element(css: '.content.active .article-new .articleNewEdit-body').text
|
|
|
+
|
|
|
+ match = full_text.match(/\nOn (.*?) Nicole Braun wrote:/)
|
|
|
+ assert_nil match
|
|
|
+
|
|
|
+ # after test, turn full quote header back on again
|
|
|
+ tasks_close_all()
|
|
|
+ ticket_open_by_title(
|
|
|
+ title: 'Welcome to Zammad',
|
|
|
+ )
|
|
|
+ change_quote_config(
|
|
|
+ css: '.modal #ui_ticket_zoom_article_email_full_quote_header select[name="ui_ticket_zoom_article_email_full_quote_header"]',
|
|
|
+ value: 'yes',
|
|
|
+ submit_css: '.modal #ui_ticket_zoom_article_email_full_quote_header .btn[type="submit"]',
|
|
|
+ )
|
|
|
end
|
|
|
|
|
|
# Regression test for issue #2344 - Missing translation for Full-Quote-Text "on xy wrote"
|
|
@@ -148,23 +190,11 @@ class AgentTicketEmailReplyKeepBodyTest < TestCase
|
|
|
)
|
|
|
|
|
|
# enable email full quote in the ticket zoom config page
|
|
|
- scroll_to(
|
|
|
- position: 'botton',
|
|
|
- css: '.content.active .js-settingContainer .js-setting .dropdown-icon',
|
|
|
- )
|
|
|
- click(css: '.content.active .js-settingContainer .js-setting .dropdown-icon')
|
|
|
- modal_ready()
|
|
|
- select(
|
|
|
+ change_quote_config(
|
|
|
css: '.modal #ui_ticket_zoom_article_email_full_quote select[name="ui_ticket_zoom_article_email_full_quote"]',
|
|
|
- value: 'yes'
|
|
|
- )
|
|
|
- click(
|
|
|
- css: '.modal #ui_ticket_zoom_article_email_full_quote .btn[type="submit"]',
|
|
|
+ value: 'yes',
|
|
|
+ submit_css: '.modal #ui_ticket_zoom_article_email_full_quote .btn[type="submit"]',
|
|
|
)
|
|
|
- modal_close()
|
|
|
- modal_disappear()
|
|
|
-
|
|
|
- exists(css: '.content.active .ticket-article [data-type="emailReply"]')
|
|
|
|
|
|
# switch user profile language to German
|
|
|
switch_language(
|