From 3f3dfebb8444e945a5cf8a42d6932e9475c7160e Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Sun, 1 Nov 2026 18:53:12 +0100 Subject: [PATCH] test: keep archived items without accountId in the client test #1480 --- lib/__tests__/jmap-archived-items.test.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/__tests__/jmap-archived-items.test.ts b/lib/__tests__/jmap-archived-items.test.ts index 794124849..78e2d04ca 100644 --- a/lib/__tests__/jmap-archived-items.test.ts +++ b/lib/__tests__/jmap-archived-items.test.ts @@ -69,15 +69,16 @@ describe('JMAPClient archived items', () => { expect(queries(spy).every(([, args]) => (args.filter as { accountId?: string })?.accountId === ACCOUNT)).toBe(true); }); - it('drops the other accounts in an unfiltered mixed answer', async () => { - // A server that ignores the filter and answers with every account. + it('drops the other accounts in an unfiltered mixed answer and keeps items without accountId', async () => { + // A server that ignores the filter and answers with every account. 'n' has + // no accountId, the way Stalwart sends items to a user without Impersonate (#1480). respondWith((body) => ({ methodResponses: body.methodCalls.map(([method, , id]) => method === 'x:ArchivedItem/query' ? [method, { ids: ['a', 'z', 'n'], total: 3 }, id] : [method, { list: [archivedEmail('a'), archivedEmail('z', { accountId: 'cz' }), archivedEmail('n', { accountId: undefined })] }, id]), })); const result = await client().listArchivedEmails(undefined, { days: 0 }); - expect(result.items.map((i) => i.id)).toEqual(['a']); + expect(result.items.map((i) => i.id)).toEqual(['a', 'n']); }); it('throws the refusal with its type when the server has no license', async () => {