From eb1609537d7d8a13be20880d7c13ecff37b52686 Mon Sep 17 00:00:00 2001 From: Aron Gates Date: Fri, 8 May 2026 14:56:27 -0400 Subject: [PATCH] test: stub store.isTemporary in useFileHandling test mocks Previous commit added `useRecoilValue(store.isTemporary)` to the hook. The test file mocks `~/store` with only `ephemeralAgentByConvoId` and does not stub `useRecoilValue`, so all 7 cases threw "Invalid argument to useRecoilValue: expected an atom or selector but got undefined". Add a stub default export with `isTemporary` and a `useRecoilValue` mock returning `false`. Co-Authored-By: Claude Opus 4.7 (1M context) --- client/src/hooks/Files/__tests__/useFileHandling.test.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/src/hooks/Files/__tests__/useFileHandling.test.ts b/client/src/hooks/Files/__tests__/useFileHandling.test.ts index 0a07c5f2b4..44ba8c2dc9 100644 --- a/client/src/hooks/Files/__tests__/useFileHandling.test.ts +++ b/client/src/hooks/Files/__tests__/useFileHandling.test.ts @@ -30,9 +30,12 @@ jest.mock('@librechat/client', () => ({ jest.mock('recoil', () => ({ ...jest.requireActual('recoil'), useSetRecoilState: jest.fn(() => jest.fn()), + useRecoilValue: jest.fn(() => false), })); jest.mock('~/store', () => ({ + __esModule: true, + default: { isTemporary: { key: 'isTemporary' } }, ephemeralAgentByConvoId: jest.fn(() => ({ key: 'mock' })), }));