From c1acf58c5fa1d221c56179dd46035a72e03a807f Mon Sep 17 00:00:00 2001 From: Stefan Hildebrandt <695494+hildebrandttk@users.noreply.github.com> Date: Sat, 11 Jul 2026 18:04:05 +0200 Subject: [PATCH] test(compose): add findComposeIdentityId to reply-identity mock The recipient chip-drag and paste tests render , which since b716f95a (feat(compose): preselect identity of the active mailbox) calls findComposeIdentityId() from @/lib/reply-identity in compose mode. Both tests mock that module but only returned resolveReplyFrom, so vitest threw "No 'findComposeIdentityId' export is defined on the mock" on mount, failing all 18 tests. Add the missing export (returns null; the composer guards with if (composeIdentityId)). --- components/email/__tests__/recipient-chip-drag.test.tsx | 5 ++++- components/email/__tests__/recipient-paste.test.tsx | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/components/email/__tests__/recipient-chip-drag.test.tsx b/components/email/__tests__/recipient-chip-drag.test.tsx index 461b4452..68f90dec 100644 --- a/components/email/__tests__/recipient-chip-drag.test.tsx +++ b/components/email/__tests__/recipient-chip-drag.test.tsx @@ -148,7 +148,10 @@ vi.mock('@/lib/email-sanitization', () => ({ parseHtmlSafely: (html: string) => new DOMParser().parseFromString(html, 'text/html'), })); -vi.mock('@/lib/reply-identity', () => ({ resolveReplyFrom: () => null })); +vi.mock('@/lib/reply-identity', () => ({ + resolveReplyFrom: () => null, + findComposeIdentityId: () => null, +})); vi.mock('@/lib/email-threading', () => ({ computeReplyThreadingHeaders: () => ({ inReplyTo: [], references: [] }), })); diff --git a/components/email/__tests__/recipient-paste.test.tsx b/components/email/__tests__/recipient-paste.test.tsx index 1a3ccef6..a8d4d15c 100644 --- a/components/email/__tests__/recipient-paste.test.tsx +++ b/components/email/__tests__/recipient-paste.test.tsx @@ -147,7 +147,10 @@ vi.mock('@/lib/email-sanitization', () => ({ parseHtmlSafely: (html: string) => new DOMParser().parseFromString(html, 'text/html'), })); -vi.mock('@/lib/reply-identity', () => ({ resolveReplyFrom: () => null })); +vi.mock('@/lib/reply-identity', () => ({ + resolveReplyFrom: () => null, + findComposeIdentityId: () => null, +})); vi.mock('@/lib/email-threading', () => ({ computeReplyThreadingHeaders: () => ({ inReplyTo: [], references: [] }), }));