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/mailnews/imap/test/unit/test_imapRename.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/mailnews/imap/test/unit/test_imapRename.js')
-rw-r--r-- | comm/mailnews/imap/test/unit/test_imapRename.js | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/comm/mailnews/imap/test/unit/test_imapRename.js b/comm/mailnews/imap/test/unit/test_imapRename.js new file mode 100644 index 0000000000..f346729a92 --- /dev/null +++ b/comm/mailnews/imap/test/unit/test_imapRename.js @@ -0,0 +1,43 @@ +/* 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/. */ + +// This tests that renaming non-ASCII name folder works. + +var { MailServices } = ChromeUtils.import( + "resource:///modules/MailServices.jsm" +); +var { PromiseTestUtils } = ChromeUtils.import( + "resource://testing-common/mailnews/PromiseTestUtils.jsm" +); + +add_setup(async function () { + setupIMAPPump(); + Services.prefs.setBoolPref( + "mail.server.default.autosync_offline_stores", + false + ); + IMAPPump.incomingServer.rootFolder.createSubfolder("folder 1", null); + await PromiseTestUtils.promiseFolderAdded("folder 1"); + + let listener = new PromiseTestUtils.PromiseUrlListener(); + IMAPPump.inbox.updateFolderWithListener(null, listener); + await listener.promise; +}); + +add_task(async function test_rename() { + let rootFolder = IMAPPump.incomingServer.rootFolder; + let targetFolder = rootFolder.getChildNamed("folder 1"); + + targetFolder.rename("folder \u00e1", null); + + IMAPPump.server.performTest("RENAME"); + let listener = new PromiseTestUtils.PromiseUrlListener(); + IMAPPump.inbox.updateFolderWithListener(null, listener); + await listener.promise; + + let folder = rootFolder.getChildNamed("folder \u00e1"); + Assert.ok(folder.msgDatabase.summaryValid); + Assert.equal("folder &AOE-", folder.filePath.leafName); + Assert.equal("folder \u00e1", folder.prettyName); +}); |