From 86cf60cb6cb0d3e0587540ce00641a7bfd97cee8 Mon Sep 17 00:00:00 2001 From: Johnpaul Date: Wed, 21 Jan 2026 01:15:34 +0100 Subject: [PATCH] test: remove explicit any types from useCoreCommands.test.ts Removed all 3 any types and replaced with proper TypeScript types. Changes: - Replaced as any with Partial> - Used as unknown as for partial mock subgraph (114+ missing properties) All tests passing (3/3), 0 typecheck errors. Part of #8092 --- src/composables/useCoreCommands.test.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/composables/useCoreCommands.test.ts b/src/composables/useCoreCommands.test.ts index 82e3439bc..e84ed6522 100644 --- a/src/composables/useCoreCommands.test.ts +++ b/src/composables/useCoreCommands.test.ts @@ -144,7 +144,9 @@ describe('useCoreCommands', () => { // Mock settings store vi.mocked(useSettingStore).mockReturnValue({ get: vi.fn().mockReturnValue(false) // Skip confirmation dialog - } as any) + } as Partial> as ReturnType< + typeof useSettingStore + >) // Mock global confirm global.confirm = vi.fn().mockReturnValue(true) @@ -167,7 +169,8 @@ describe('useCoreCommands', () => { it('should preserve input/output nodes when clearing subgraph', async () => { // Set up subgraph context - app.canvas.subgraph = mockSubgraph as any + app.canvas.subgraph = + mockSubgraph as unknown as typeof app.canvas.subgraph const commands = useCoreCommands() const clearCommand = commands.find( @@ -198,7 +201,9 @@ describe('useCoreCommands', () => { // Mock confirmation required vi.mocked(useSettingStore).mockReturnValue({ get: vi.fn().mockReturnValue(true) // Require confirmation - } as any) + } as Partial> as ReturnType< + typeof useSettingStore + >) global.confirm = vi.fn().mockReturnValue(false) // User cancels