mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-05 15:40:10 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user