From 465320dbfbbfb65419b8184e86a7b061b75bbb02 Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Sun, 1 Nov 2026 10:51:54 +0100 Subject: [PATCH] test: say no plugin checks sends in the composer draft-login test The test's mocked onBeforeEmailSend had no size, so the composer took it for a listening send check and built the check's message, which reads the sending login's identities from a client the test mocks without getIdentities; the send stopped there. The real bus without a plugin has size 0, which the mock now says too. --- components/email/__tests__/composer-draft-login.test.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/email/__tests__/composer-draft-login.test.tsx b/components/email/__tests__/composer-draft-login.test.tsx index 3850f43a2..0e8ef5923 100644 --- a/components/email/__tests__/composer-draft-login.test.tsx +++ b/components/email/__tests__/composer-draft-login.test.tsx @@ -155,7 +155,10 @@ vi.mock('@/lib/plugin-hooks', () => ({ onRecipientChipsChange: { transform: async (chips: unknown) => chips }, onDraftChange: { emit: () => {} }, onBeforeDraftAutoSave: { transform: async (draft: unknown) => draft }, - onBeforeEmailSend: { intercept: async () => true, interceptOutcome: async () => 'allowed' }, + // No plugin checks sends here (size 0, as the real bus without one): the + // message for a send check would be built otherwise, reading the other + // login's identities from a client this test only half mocks. + onBeforeEmailSend: { size: 0, intercept: async () => true, interceptOutcome: async () => 'allowed' }, onComposeSend: { intercept: async () => true, takeOver: async () => 'default' }, onTransformOutgoingEmail: { transform: async (email: unknown) => email }, },