From 52ea2da66d700fb4f6db91871c9d6d9acf1aab69 Mon Sep 17 00:00:00 2001 From: Aron Gates Date: Thu, 7 May 2026 01:25:18 -0700 Subject: [PATCH] fix: use mockSanitizeArtifactPath in retention test The 'getRetentionExpiry is called with the request object' test referenced an undefined `mockSanitizeFilename` identifier, breaking both lint (no-undef) and the test suite. Use the existing `mockSanitizeArtifactPath` mock that the surrounding tests already use, since `processCodeOutput` calls `sanitizeArtifactPath` (not `sanitizeFilename`) before invoking `getRetentionExpiry`. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../services/Files/Code/__tests__/process-traversal.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/server/services/Files/Code/__tests__/process-traversal.spec.js b/api/server/services/Files/Code/__tests__/process-traversal.spec.js index b7c62e3d79..d36cd5c7af 100644 --- a/api/server/services/Files/Code/__tests__/process-traversal.spec.js +++ b/api/server/services/Files/Code/__tests__/process-traversal.spec.js @@ -139,7 +139,7 @@ describe('processCodeOutput path traversal protection', () => { }); test('getRetentionExpiry is called with the request object', async () => { - mockSanitizeFilename.mockReturnValueOnce('output.csv'); + mockSanitizeArtifactPath.mockReturnValueOnce('output.csv'); await processCodeOutput({ ...baseParams, name: 'output.csv' }); expect(getRetentionExpiry).toHaveBeenCalledWith(baseParams.req); });