This commit is contained in:
parent
2e450aea97
commit
f8777a6adf
@ -21,7 +21,7 @@ interface ImapClientI {
|
||||
) => Promise<FetchMessageObject[]>;
|
||||
connect: () => Promise<void>;
|
||||
getMailboxLock: (mailbox: string) => Promise<MailboxLockObject>;
|
||||
messageDelete: (uids: number[]) => Promise<boolean>;
|
||||
messageDelete: (uids: number[], opts: any) => Promise<boolean>;
|
||||
close: () => void;
|
||||
}
|
||||
|
||||
@ -257,8 +257,7 @@ export const perform = (
|
||||
// cleanup.
|
||||
TE.bind("deleted", ({ imap, uid, mailboxLock }) =>
|
||||
TE.tryCatch(
|
||||
// () => imap.messageDelete([uid], { uid: true }),
|
||||
() => imap.messageDelete([uid]),
|
||||
() => imap.messageDelete([uid], { uid: true }),
|
||||
ToErrorWithLock(mailboxLock),
|
||||
),
|
||||
),
|
||||
|
@ -146,7 +146,7 @@ test("cleans up sent messages from inbox", async () => {
|
||||
perform(emailJob, mockDependencies),
|
||||
TE.map(() => {
|
||||
expect(imap.messageDelete).toHaveBeenCalledTimes(1);
|
||||
expect(imap.messageDelete).toHaveBeenCalledWith([1]);
|
||||
expect(imap.messageDelete).toHaveBeenCalledWith([1], { uid: true });
|
||||
}),
|
||||
TE.mapLeft(() => expect(false).toBeTruthy()),
|
||||
)();
|
||||
|
Loading…
Reference in New Issue
Block a user