test: remove explicit any types from useGraphHierarchy.test.ts

Removed all 3 any types and replaced with proper TypeScript types.

Changes:
- Replaced as any with as unknown as for partial mockCanvasStore
- Removed as any from null assignments (TypeScript infers correctly)

All tests passing (7/7), 0 typecheck errors.

Part of #8092
This commit is contained in:
Johnpaul
2026-01-21 01:21:05 +01:00
parent 0fb836b294
commit 2bd5dea728

View File

@@ -26,7 +26,7 @@ describe('useGraphHierarchy', () => {
groups: mockGroups
}
}
} as any
} as unknown as ReturnType<typeof useCanvasStore>
vi.mocked(useCanvasStore).mockReturnValue(mockCanvasStore)
})
@@ -113,7 +113,7 @@ describe('useGraphHierarchy', () => {
})
it('handles null canvas gracefully', () => {
mockCanvasStore.canvas = null as any
mockCanvasStore.canvas = null
const { findParentGroup } = useGraphHierarchy()
const result = findParentGroup(mockNode)
@@ -122,7 +122,7 @@ describe('useGraphHierarchy', () => {
})
it('handles null graph gracefully', () => {
mockCanvasStore.canvas!.graph = null as any
mockCanvasStore.canvas!.graph = null
const { findParentGroup } = useGraphHierarchy()
const result = findParentGroup(mockNode)