From c3c34093baea3617e69db83b2cba2199e7cffa14 Mon Sep 17 00:00:00 2001 From: Connor Yoh Date: Thu, 11 Sep 2025 11:22:01 +0100 Subject: [PATCH] Fix tests --- .../src/components/fileManager/FileActions.tsx | 15 +++++++-------- .../addPassword/useAddPasswordOperation.test.ts | 2 +- .../useChangePermissionsOperation.test.ts | 2 +- .../useRemovePasswordOperation.test.ts | 2 +- .../src/tests/convert/ConvertIntegration.test.tsx | 4 ++-- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/frontend/src/components/fileManager/FileActions.tsx b/frontend/src/components/fileManager/FileActions.tsx index 4aa62d54c..dfcf0403e 100644 --- a/frontend/src/components/fileManager/FileActions.tsx +++ b/frontend/src/components/fileManager/FileActions.tsx @@ -1,20 +1,19 @@ import React from "react"; -import { Group, Text, ActionIcon, Tooltip, Switch } from "@mantine/core"; +import { Group, Text, ActionIcon, Tooltip } from "@mantine/core"; import SelectAllIcon from "@mui/icons-material/SelectAll"; import DeleteIcon from "@mui/icons-material/Delete"; import DownloadIcon from "@mui/icons-material/Download"; -import HistoryIcon from "@mui/icons-material/History"; import { useTranslation } from "react-i18next"; import { useFileManagerContext } from "../../contexts/FileManagerContext"; const FileActions: React.FC = () => { const { t } = useTranslation(); - const { - recentFiles, - selectedFileIds, - filteredFiles, - onSelectAll, - onDeleteSelected, + const { + recentFiles, + selectedFileIds, + filteredFiles, + onSelectAll, + onDeleteSelected, onDownloadSelected } = useFileManagerContext(); diff --git a/frontend/src/hooks/tools/addPassword/useAddPasswordOperation.test.ts b/frontend/src/hooks/tools/addPassword/useAddPasswordOperation.test.ts index 53f6f7854..b92da0033 100644 --- a/frontend/src/hooks/tools/addPassword/useAddPasswordOperation.test.ts +++ b/frontend/src/hooks/tools/addPassword/useAddPasswordOperation.test.ts @@ -119,7 +119,7 @@ describe('useAddPasswordOperation', () => { test.each([ { property: 'toolType' as const, expectedValue: ToolType.singleFile }, { property: 'endpoint' as const, expectedValue: '/api/v1/security/add-password' }, - { property: 'filePrefix' as const, expectedValue: 'translated-addPassword.filenamePrefix_' }, + { property: 'filePrefix' as const, expectedValue: undefined }, { property: 'operationType' as const, expectedValue: 'addPassword' } ])('should configure $property correctly', ({ property, expectedValue }) => { renderHook(() => useAddPasswordOperation()); diff --git a/frontend/src/hooks/tools/changePermissions/useChangePermissionsOperation.test.ts b/frontend/src/hooks/tools/changePermissions/useChangePermissionsOperation.test.ts index 682653e9e..6748b5547 100644 --- a/frontend/src/hooks/tools/changePermissions/useChangePermissionsOperation.test.ts +++ b/frontend/src/hooks/tools/changePermissions/useChangePermissionsOperation.test.ts @@ -113,7 +113,7 @@ describe('useChangePermissionsOperation', () => { test.each([ { property: 'toolType' as const, expectedValue: ToolType.singleFile }, { property: 'endpoint' as const, expectedValue: '/api/v1/security/add-password' }, - { property: 'filePrefix' as const, expectedValue: 'permissions_' }, + { property: 'filePrefix' as const, expectedValue: undefined }, { property: 'operationType' as const, expectedValue: 'change-permissions' } ])('should configure $property correctly', ({ property, expectedValue }) => { renderHook(() => useChangePermissionsOperation()); diff --git a/frontend/src/hooks/tools/removePassword/useRemovePasswordOperation.test.ts b/frontend/src/hooks/tools/removePassword/useRemovePasswordOperation.test.ts index cdaa7b416..0bb12920f 100644 --- a/frontend/src/hooks/tools/removePassword/useRemovePasswordOperation.test.ts +++ b/frontend/src/hooks/tools/removePassword/useRemovePasswordOperation.test.ts @@ -97,7 +97,7 @@ describe('useRemovePasswordOperation', () => { test.each([ { property: 'toolType' as const, expectedValue: ToolType.singleFile }, { property: 'endpoint' as const, expectedValue: '/api/v1/security/remove-password' }, - { property: 'filePrefix' as const, expectedValue: 'translated-removePassword.filenamePrefix_' }, + { property: 'filePrefix' as const, expectedValue: undefined }, { property: 'operationType' as const, expectedValue: 'removePassword' } ])('should configure $property correctly', ({ property, expectedValue }) => { renderHook(() => useRemovePasswordOperation()); diff --git a/frontend/src/tests/convert/ConvertIntegration.test.tsx b/frontend/src/tests/convert/ConvertIntegration.test.tsx index bf2c46662..3aa2f5b6b 100644 --- a/frontend/src/tests/convert/ConvertIntegration.test.tsx +++ b/frontend/src/tests/convert/ConvertIntegration.test.tsx @@ -141,7 +141,7 @@ describe('Convert Tool Integration Tests', () => { // Verify hook state updates expect(result.current.downloadUrl).toBeTruthy(); - expect(result.current.downloadFilename).toBe('test_converted.png'); + expect(result.current.downloadFilename).toBe('test.png'); expect(result.current.isLoading).toBe(false); expect(result.current.errorMessage).toBe(null); }); @@ -363,7 +363,7 @@ describe('Convert Tool Integration Tests', () => { // Verify hook state updates correctly expect(result.current.downloadUrl).toBeTruthy(); - expect(result.current.downloadFilename).toBe('test_converted.csv'); + expect(result.current.downloadFilename).toBe('test.csv'); expect(result.current.isLoading).toBe(false); expect(result.current.errorMessage).toBe(null); });