summaryrefslogtreecommitdiff
path: root/tst
diff options
context:
space:
mode:
authorElizabeth Hunt <elizabeth.hunt@simponic.xyz>2024-12-15 12:29:30 -0800
committerElizabeth Hunt <elizabeth.hunt@simponic.xyz>2024-12-15 12:29:30 -0800
commit6f45fe5a10174fd33932d17dc056898f06466067 (patch)
tree733bdf08f762e09e1db2a44320ae17c096393086 /tst
parent8e5fabec3e216ef55927909368c4013235fba729 (diff)
downloaduptime-6f45fe5a10174fd33932d17dc056898f06466067.tar.gz
uptime-6f45fe5a10174fd33932d17dc056898f06466067.zip
close the mailbox
Diffstat (limited to 'tst')
-rw-r--r--tst/email.spec.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/tst/email.spec.ts b/tst/email.spec.ts
index e966030..79c21cc 100644
--- a/tst/email.spec.ts
+++ b/tst/email.spec.ts
@@ -32,6 +32,7 @@ const getMocks = () => {
getMailboxLock: mock(() => Promise.resolve(lock)),
messageDelete: mock(() => Promise.resolve(true)),
logout: mock(() => Promise.resolve()),
+ mailboxClose: mock(() => Promise.resolve()),
};
const mockDependencies: Partial<EmailJobDependencies> = {
@@ -116,6 +117,7 @@ test("releases lock on left", async () => {
TE.mapLeft(() => {
expect(imap.getMailboxLock).toHaveBeenCalledTimes(1);
expect(lock.release).toHaveBeenCalledTimes(1);
+ expect(imap.mailboxClose).toHaveBeenCalledTimes(1);
expect(imap.logout).toHaveBeenCalledTimes(1);
}),
)();
@@ -133,6 +135,7 @@ test("releases lock on right", async () => {
expect(imap.getMailboxLock).toHaveBeenCalledTimes(1);
expect(lock.release).toHaveBeenCalledTimes(1);
expect(imap.logout).toHaveBeenCalledTimes(1);
+ expect(imap.mailboxClose).toHaveBeenCalledTimes(1);
}),
TE.mapLeft(() => expect(false).toBeTruthy()),
)();