diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
commit | 6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /comm/mail/test/browser/composition/browser_subjectWas.js | |
parent | Initial commit. (diff) | |
download | thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.tar.xz thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.zip |
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'comm/mail/test/browser/composition/browser_subjectWas.js')
-rw-r--r-- | comm/mail/test/browser/composition/browser_subjectWas.js | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/comm/mail/test/browser/composition/browser_subjectWas.js b/comm/mail/test/browser/composition/browser_subjectWas.js new file mode 100644 index 0000000000..c76a719ce5 --- /dev/null +++ b/comm/mail/test/browser/composition/browser_subjectWas.js @@ -0,0 +1,65 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/** + * Tests that replying in to mail with subject change (was: old) style will + * do the right thing. + */ + +"use strict"; + +var { close_compose_window, open_compose_with_reply } = ChromeUtils.import( + "resource://testing-common/mozmill/ComposeHelpers.jsm" +); +var { + add_message_to_folder, + assert_selected_and_displayed, + be_in_folder, + create_folder, + create_message, + mc, + select_click_row, +} = ChromeUtils.import( + "resource://testing-common/mozmill/FolderDisplayHelpers.jsm" +); + +var folder = null; + +add_setup(async function () { + folder = await create_folder("SubjectWas"); + await add_message_to_folder( + [folder], + create_message({ + subject: "New subject (was: Old subject)", + body: { body: "Testing thread subject switch reply." }, + clobberHeaders: { + References: "<97010db3-bd55-34e0-b08b-841b2a9ff0ec@test>", + }, + }) + ); + registerCleanupFunction(() => folder.deleteSelf(null)); +}); + +/** + * Test that the subject is set properly in the replied message. + */ +add_task(async function test_was_reply_subj() { + await be_in_folder(folder); + + let msg = select_click_row(0); + assert_selected_and_displayed(mc, msg); + + let cwc = open_compose_with_reply(); + + let msgSubject = cwc.window.document.getElementById("msgSubject").value; + + // Subject should be Re: <the original subject stripped of the was: part> + Assert.equal( + msgSubject, + "Re: New subject", + "was: part of subject should have been removed" + ); + + close_compose_window(cwc); +}); |