From 6bf0a5cb5034a7e684dcc3500e841785237ce2dd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 19:32:43 +0200 Subject: Adding upstream version 1:115.7.0. Signed-off-by: Daniel Baumann --- comm/mailnews/local/test/unit/test_preview.js | 40 +++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 comm/mailnews/local/test/unit/test_preview.js (limited to 'comm/mailnews/local/test/unit/test_preview.js') diff --git a/comm/mailnews/local/test/unit/test_preview.js b/comm/mailnews/local/test/unit/test_preview.js new file mode 100644 index 0000000000..83cfce256b --- /dev/null +++ b/comm/mailnews/local/test/unit/test_preview.js @@ -0,0 +1,40 @@ +var bugmail10 = do_get_file("../../../data/bugmail10"); +var bugmail11 = do_get_file("../../../data/bugmail11"); +var bugmail10_preview = + "Do not reply to this email. You can add comments to this bug at https://bugzilla.mozilla.org/show_bug.cgi?id=436880 -- Configure bugmail: https://bugzilla.mozilla.org/userprefs.cgi?tab=email ------- You are receiving this mail because: -----"; +var bugmail11_preview = + "Bugzilla has received a request to create a user account using your email address (example@example.org). To confirm that you want to create an account using that email address, visit the following link: https://bugzilla.mozilla.org/token.cgi?t=xxx"; + +function run_test() { + do_test_pending(); + copyFileMessageInLocalFolder(bugmail10, 0, "", null, copy_next_message); +} + +function copy_next_message(aMessageHeaderKeys, aStatus) { + copyFileMessageInLocalFolder(bugmail11, 0, "", null, test_preview); +} + +function test_preview(aMessageHeaderKeys, aStatus) { + let headerKeys = aMessageHeaderKeys; + Assert.notEqual(headerKeys, null); + Assert.equal(headerKeys.length, 2); + try { + localAccountUtils.inboxFolder.fetchMsgPreviewText(headerKeys, null); + Assert.equal( + localAccountUtils.inboxFolder + .GetMessageHeader(headerKeys[0]) + .getStringProperty("preview"), + bugmail10_preview + ); + Assert.equal( + localAccountUtils.inboxFolder + .GetMessageHeader(headerKeys[1]) + .getStringProperty("preview"), + bugmail11_preview + ); + } catch (ex) { + dump(ex); + do_throw(ex); + } + do_test_finished(); +} -- cgit v1.2.3