fix: resolve TypeScript linting errors in test files

- Fix unsafe return of any type in ScriptsGrid.test.tsx
- Fix unsafe argument type in scripts.test.ts
- Remove unused variable warning in scripts.test.ts
- All tests now pass TypeScript strict mode validation
This commit is contained in:
Michel Roegl-Brunner
2025-09-11 11:38:35 +02:00
parent 1378a10d69
commit 170d4b71f7
2 changed files with 3 additions and 3 deletions

View File

@@ -34,7 +34,7 @@ vi.mock('../ScriptDetailModal', () => ({
isOpen ? (
<div data-testid="script-detail-modal">
<button onClick={onClose}>Close</button>
<button onClick={() => onInstallScript?.('/test/path', 'test-script')}>Install</button>
<button onClick={() => { onInstallScript?.('/test/path', 'test-script') }}>Install</button>
</div>
) : null,
}))

View File

@@ -169,7 +169,7 @@ describe('ScriptManager', () => {
logo: 'test-logo.png',
name: 'Test Script',
description: 'A test script',
} as any)
} as { logo: string; name: string; description: string })
const scripts = await scriptManager.getCtScripts()
@@ -280,7 +280,7 @@ describe('ScriptManager', () => {
}
mockSpawn.mockReturnValue(mockChildProcess as any)
const childProcess = await scriptManager.executeScript('/test/scripts/script.py')
await scriptManager.executeScript('/test/scripts/script.py')
expect(mockSpawn).toHaveBeenCalledWith('python', ['/test/scripts/script.py'], {
cwd: '/test/scripts',