From 489a2b2f5ff31d64fdbe8fc867d62343e4f919f4 Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Wed, 28 Oct 2026 10:20:15 +0100 Subject: [PATCH] test: give the thread row test's auth store the state the plugin actions read --- components/email/__tests__/thread-list-item.test.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/components/email/__tests__/thread-list-item.test.tsx b/components/email/__tests__/thread-list-item.test.tsx index 712f7d7ff..74e875c7b 100644 --- a/components/email/__tests__/thread-list-item.test.tsx +++ b/components/email/__tests__/thread-list-item.test.tsx @@ -12,10 +12,13 @@ vi.mock('@/hooks/use-email-drag', () => ({ })); vi.mock('@/stores/auth-store', () => { - const state = { identities: [], username: null }; - return { - useAuthStore: (selector?: (s: typeof state) => unknown) => (selector ? selector(state) : state), - }; + const state = { identities: [], username: null, client: null, activeAccountId: null, getClientForAccount: () => undefined }; + // getState for the plugin action target (resolveEmailBlobContext). + const useAuthStore = Object.assign( + (selector?: (s: typeof state) => unknown) => (selector ? selector(state) : state), + { getState: () => state }, + ); + return { useAuthStore }; }); const ACCOUNT_TEAL = { id: 'acct-teal', avatarColor: '#0d9488', label: 'Teal account' };