mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-09-18 09:29:24 +00:00
Fix tests
This commit is contained in:
parent
5b939f7b4b
commit
c3c34093ba
@ -1,9 +1,8 @@
|
|||||||
import React from "react";
|
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 SelectAllIcon from "@mui/icons-material/SelectAll";
|
||||||
import DeleteIcon from "@mui/icons-material/Delete";
|
import DeleteIcon from "@mui/icons-material/Delete";
|
||||||
import DownloadIcon from "@mui/icons-material/Download";
|
import DownloadIcon from "@mui/icons-material/Download";
|
||||||
import HistoryIcon from "@mui/icons-material/History";
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { useFileManagerContext } from "../../contexts/FileManagerContext";
|
import { useFileManagerContext } from "../../contexts/FileManagerContext";
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ describe('useAddPasswordOperation', () => {
|
|||||||
test.each([
|
test.each([
|
||||||
{ property: 'toolType' as const, expectedValue: ToolType.singleFile },
|
{ property: 'toolType' as const, expectedValue: ToolType.singleFile },
|
||||||
{ property: 'endpoint' as const, expectedValue: '/api/v1/security/add-password' },
|
{ 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' }
|
{ property: 'operationType' as const, expectedValue: 'addPassword' }
|
||||||
])('should configure $property correctly', ({ property, expectedValue }) => {
|
])('should configure $property correctly', ({ property, expectedValue }) => {
|
||||||
renderHook(() => useAddPasswordOperation());
|
renderHook(() => useAddPasswordOperation());
|
||||||
|
@ -113,7 +113,7 @@ describe('useChangePermissionsOperation', () => {
|
|||||||
test.each([
|
test.each([
|
||||||
{ property: 'toolType' as const, expectedValue: ToolType.singleFile },
|
{ property: 'toolType' as const, expectedValue: ToolType.singleFile },
|
||||||
{ property: 'endpoint' as const, expectedValue: '/api/v1/security/add-password' },
|
{ 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' }
|
{ property: 'operationType' as const, expectedValue: 'change-permissions' }
|
||||||
])('should configure $property correctly', ({ property, expectedValue }) => {
|
])('should configure $property correctly', ({ property, expectedValue }) => {
|
||||||
renderHook(() => useChangePermissionsOperation());
|
renderHook(() => useChangePermissionsOperation());
|
||||||
|
@ -97,7 +97,7 @@ describe('useRemovePasswordOperation', () => {
|
|||||||
test.each([
|
test.each([
|
||||||
{ property: 'toolType' as const, expectedValue: ToolType.singleFile },
|
{ property: 'toolType' as const, expectedValue: ToolType.singleFile },
|
||||||
{ property: 'endpoint' as const, expectedValue: '/api/v1/security/remove-password' },
|
{ 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' }
|
{ property: 'operationType' as const, expectedValue: 'removePassword' }
|
||||||
])('should configure $property correctly', ({ property, expectedValue }) => {
|
])('should configure $property correctly', ({ property, expectedValue }) => {
|
||||||
renderHook(() => useRemovePasswordOperation());
|
renderHook(() => useRemovePasswordOperation());
|
||||||
|
@ -141,7 +141,7 @@ describe('Convert Tool Integration Tests', () => {
|
|||||||
|
|
||||||
// Verify hook state updates
|
// Verify hook state updates
|
||||||
expect(result.current.downloadUrl).toBeTruthy();
|
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.isLoading).toBe(false);
|
||||||
expect(result.current.errorMessage).toBe(null);
|
expect(result.current.errorMessage).toBe(null);
|
||||||
});
|
});
|
||||||
@ -363,7 +363,7 @@ describe('Convert Tool Integration Tests', () => {
|
|||||||
|
|
||||||
// Verify hook state updates correctly
|
// Verify hook state updates correctly
|
||||||
expect(result.current.downloadUrl).toBeTruthy();
|
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.isLoading).toBe(false);
|
||||||
expect(result.current.errorMessage).toBe(null);
|
expect(result.current.errorMessage).toBe(null);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user