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/local/test/unit/test_pop3Pump.js | |
parent | Initial commit. (diff) | |
download | thunderbird-upstream.tar.xz thunderbird-upstream.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/local/test/unit/test_pop3Pump.js')
-rw-r--r-- | comm/mailnews/local/test/unit/test_pop3Pump.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/comm/mailnews/local/test/unit/test_pop3Pump.js b/comm/mailnews/local/test/unit/test_pop3Pump.js new file mode 100644 index 0000000000..239d284abb --- /dev/null +++ b/comm/mailnews/local/test/unit/test_pop3Pump.js @@ -0,0 +1,32 @@ +/** + * The intent of this file is to demonstrate a minimal + * POP3 unit test using the testing file POP3Pump.js + */ +/* import-globals-from ../../../test/resources/POP3pump.js */ +load("../../../resources/POP3pump.js"); + +var testSubjects = [ + "[Bug 397009] A filter will let me tag, but not untag", + "Hello, did you receive my bugmail?", +]; + +add_task(async function runPump() { + // demonstration of access to the local inbox folder + dump( + "local inbox folder " + localAccountUtils.inboxFolder.URI + " is loaded\n" + ); + // demonstration of access to the fake server + dump("Server " + gPOP3Pump.fakeServer.prettyName + " is loaded\n"); + + gPOP3Pump.files = ["../../../data/bugmail1", "../../../data/draft1"]; + await gPOP3Pump.run(); + + // get message headers for the inbox folder + var msgCount = 0; + for (let hdr of localAccountUtils.inboxFolder.msgDatabase.enumerateMessages()) { + msgCount++; + Assert.equal(hdr.subject, testSubjects[msgCount - 1]); + } + Assert.equal(msgCount, 2); + gPOP3Pump = null; +}); |