Commit Graph

6469 Commits

Author SHA1 Message Date
Johnpaul
cbd5e7fed3 refactor: remove any types from batch 16 test files (6 instances)
Fixed 6 'as any' instances across 2 files:
- subgraphStore.test.ts: Used ReturnType for getUserData mock and ExportedSubgraph for subgraph serialization
- modelToNodeStore.test.ts: Used proper type casts for invalid input test cases
2026-01-22 22:39:13 +01:00
Johnpaul
cc6da76aa9 refactor: remove any types from batch 15 test files (10 instances)
Fixed 10 'as any' instances across 5 files:
- keybindingService.escape.test.ts: Used ReturnType for dialog store mock
- nodeHelpStore.test.ts: Used ComfyNodeDefImpl type for node parameter
- comfyRegistryStore.test.ts: Used ReturnType for registry service mock
- domWidgetStore.test.ts: Used LGraphNode for mock node property
- executionStore.test.ts: Used LGraphNode for mock subgraph nodes
2026-01-22 22:34:27 +01:00
Johnpaul
35ddd998ec refactor: remove any types from batch 14 test files (6 instances)
Fixed 6 'as any' instances across 3 files:
- LinkConnector.core.test.ts: Used Parameters utility type for method parameters
- useSelectionState.test.ts: Used ReturnType for composable and filter returns
- SubgraphNode.test.ts: Used SubgraphEventMap for event dispatch typing
2026-01-22 22:28:43 +01:00
Johnpaul
07a89ed0cb refactor: remove as any from 4 test files (batch 13)
Fixed 20 instances across:
- useWatchWidget.test.ts (5): Remove callback casts, call with proper args
- BypassButton.test.ts (5): Cast mock nodes as unknown as LGraphNode
- LinkConnector.test.ts (5): Use CanvasPointerEvent instead of Event, type render links properly
- executableGroupNodeChildDTO.test.ts (5): Cast to unknown as LGraphNode, use vi.mocked()

Key patterns:
- Widget callbacks now called with value argument
- Partial mock objects use as unknown as TargetType
- vi.mocked() wrapper for accessing mock methods after type casting
2026-01-22 22:16:29 +01:00
Johnpaul
87c01c9819 refactor: remove as any from 5 test files (batch 12)
Fixed 31 instances across:
- typeGuardUtil.test.ts: Use Parameters utility type for partial mocks
- graphTraversalUtil.test.ts: Use proper type assertions for property mutations and invalid input testing
- subgraphNavigationStore.viewport.test.ts: Import Subgraph type, fix mock canvas typing
- useCanvasManager.test.ts: Use as unknown as Type for mutable mock store properties
- useCanvasTools.test.ts: Use as unknown as Type for mutable mock store properties

The canvas mock store pattern now uses as unknown as HTMLCanvasElement/CanvasRenderingContext2D
at both declaration and assignment points to allow partial mocks while maintaining type safety.
2026-01-22 22:09:19 +01:00
Johnpaul
981394830c refactor: remove as any from 5 test files (batch 11)
- useWorkflowAutoSave.test.ts (12 instances)
- ToOutputRenderLink.test.ts (12 instances)
- useMinimapRenderer.test.ts (9 instances)
- SubgraphEdgeCases.test.ts (8 instances)
- SignInForm.test.ts (8 instances)
2026-01-22 21:59:10 +01:00
Johnpaul
a40ab32a49 refactor: remove as any from useMinimapInteraction.test.ts 2026-01-22 21:41:22 +01:00
Johnpaul
3891df9a03 refactor: remove as any from useTransformState.test.ts 2026-01-22 21:37:58 +01:00
Johnpaul
49d2a71119 refactor: remove as any from useRemoteWidget.test.ts 2026-01-22 21:21:23 +01:00
Johnpaul
82413c17c2 refactor: remove as any from workflowStore.test.ts 2026-01-22 20:57:05 +01:00
Johnpaul
a9151795ae refactor: remove as any from LinkConnector.integration.test.ts 2026-01-22 20:20:01 +01:00
Johnpaul
7e7971f96c refactor: remove as any from useMinimapGraph.test.ts 2026-01-22 20:08:28 +01:00
Johnpaul
ea961f9128 refactor: remove as any from useMinimapViewport.test.ts 2026-01-22 19:53:04 +01:00
Johnpaul
61de77b981 refactor: remove as any from SelectionToolbox.test.ts 2026-01-22 19:43:31 +01:00
Johnpaul
3203ec5478 refactor: remove as any from useManagerState.test.ts 2026-01-22 19:37:42 +01:00
Johnpaul
fd8118564a refactor: remove 'as any' assertions from test files (batch 1: 16 files)
- Fixed 15 as any type assertions across 16 test files
- Used proper TypeScript types: unknown, Settings, ComfyWorkflowJSON, etc.
- Added missing type imports where needed
- Replaced as any with proper type intersections for Vue component testing

Files modified:
- ComboWidget.test.ts: Use explicit Values union type
- settingStore.test.ts: Import and use Settings type
- WhatsNewPopup.test.ts: Type assertion with component interface
- useMinimap.test.ts: Remove unnecessary cast (renderMinimap is public)
- LGraphNode.test.ts: Remove unnecessary any cast from undefined
- WidgetGalleria.test.ts: Type intersection for vm access
- WidgetInputNumberInput.test.ts: Use unknown to number cast
- jobOutputCache.test.ts: Import ComfyWorkflowJSON type
- mediaCacheService.test.ts: Use Partial<typeof URL> cast
- registrySearchProvider.test.ts: Use ReturnType<typeof store>
- firebaseAuthStore.test.ts: Cast to UserCredential
- queueStore.test.ts: Use Record<string, unknown> for delete
- usePacksSelection.test.ts: Cast undefined to unknown to string
- usePacksStatus.test.ts: Cast undefined to unknown to string
- useConflictDetection.test.ts: Use inline type for ImportFailInfo

Reduced as any count from 326 to 311 instances.
2026-01-22 19:32:16 +01:00
Johnpaul
181f8c3a88 refactor: remove any types from modelStore, surveyNormalization, and SurveyResponses
- modelStore.ts: Changed _findInMetadata metadata parameter from any to Record<string, unknown> with type guards
- surveyNormalization.ts: Changed normalizeSurveyResponses to use generic Record<string, unknown> constraint with proper type guards
- types.ts: Added index signature to SurveyResponses to allow normalized properties
2026-01-22 19:13:42 +01:00
Johnpaul
5683c388e4 refactor: remove any types from fuseUtil, ui, isobmff, and fix clipspace
- fuseUtil.ts: Changed isFuseSearchable type guard from any to unknown with proper null checks
- ui.ts: Changed Props index signature from any to unknown
- isobmff.ts: Changed extractJson return type from any to unknown with type assertion at call site
- clipspace.ts: Fixed pre-existing typecheck error by changing createImgSettings and createImgPreview to return null instead of empty array
2026-01-22 19:07:26 +01:00
Johnpaul
35139da175 refactor: remove any types from widget and template files
- widgetInputs: use TWidgetValue[] for controlValues instead of any[]
- nodeTemplates: define NodeTemplate interface with name and data properties
2026-01-22 17:59:37 +01:00
Johnpaul
2282f37fb5 refactor: remove any types from utility files and components
- syncUtil: use UserDataFullInfo type from apiSchema for file parameters
- linkFixer: change logger parameters from any[] to unknown[]
- useChainCallback: use NonNullable and conditional types instead of any constraint
- FormRadioGroup: type modelValue as string | number | undefined
- async.ts: define GlobalWindow as typeof globalThis
- widgetInputs: use Parameters<NonNullable<T>> for callback parameters
- useWorkflowValidation: update logger to accept unknown[] parameters
2026-01-22 04:24:45 +01:00
Johnpaul
a02f7a15ff refactor: replace custom callback types with TypeScript built-in utilities
- Use Parameters<NonNullable<T>> and ReturnType<NonNullable<T>> instead of custom CallbackParams/CallbackReturn types
- Change any[] to unknown[] in extensionService invokeExtensions methods
- Update contextMenuFilter.test.ts with type assertions for extension results
2026-01-22 03:56:29 +01:00
Johnpaul
2aa4885696 refactor: remove any types from test files (batch 5)
Remove explicit any types from 14 test files:
- useMissingNodes.test.ts (1 instance)
- DescriptionTabPanel.test.ts (1 instance)
- PackEnableToggle.test.ts (3 instances)
- NodeConflictDialogContent.test.ts (7 instances)
- queueStore.test.ts (2 instances)
- useIntWidget.test.ts (1 instance)
- useFloatWidget.test.ts (1 instance)
- FormSelectButton.test.ts (3 instances)
- useTemplateWorkflows.test.ts (1 instance)
- useFrontendVersionMismatchWarning.test.ts (1 instance)
- releaseService.test.ts (1 instance)
- useSubscription.test.ts (1 instance)
- assetService.test.ts (1 instance)
- ResultGallery.test.ts (2 instances)

Used typed mock objects, ReturnType pattern, and specific type aliases
where appropriate. All changes pass typecheck with 0 errors.
2026-01-22 03:30:18 +01:00
Johnpaul
dbf6d02f0d refactor: remove any types from subgraphNavigationStore.test.ts
Remove explicit any types from 1 test file:
- subgraphNavigationStore.test.ts (11 instances)

Used typeof workflowStore.activeWorkflow to properly type workflow
mock assignments instead of the broader ComfyWorkflow type.
2026-01-22 00:20:55 +01:00
Johnpaul
06dbb0fd32 refactor: remove any types from test files (batch 3)
Remove explicit any types from 2 test files:
- firebaseAuthStore.test.ts (10 instances)
- useMinimapSettings.test.ts (10 instances)

Changes:
- Created MockAuth type for firebase auth mocks
- Used UserCredential type for firebase user credential mocks
- Used `ReturnType<typeof func>` to derive proper store types
- Changed Record<string, any> to Record<string, unknown>

All changes pass typecheck and tests.
2026-01-22 00:16:15 +01:00
Johnpaul
94fc1f6e30 refactor: remove any types from test files (batch 2)
Remove explicit any types from 3 test files:
- SubgraphMemory.test.ts (10 instances)
- minimapCanvasRenderer.test.ts (8 instances)
- useImageLoader.test.ts (8 instances)

Changes:
- Created InputWithWidget type for test-specific widget properties
- Used `unknown` type with proper type annotations for mock store properties
- Used `as unknown as T` pattern for mock objects
- Used `ReturnType<typeof func>` for store mock return types

All changes pass typecheck and tests.
2026-01-22 00:08:42 +01:00
Johnpaul
27359f945b refactor: remove any types from test files (batch 1)
Remove explicit any types from 7 test files:
- useWatchWidget.test.ts (3 instances)
- LGraphNodeProperties.test.ts (2 instances)
- versionCompatibilityStore.test.ts (2 instances)
- workflowStore.test.ts (2 instances)
- useRemoteWidget.test.ts (2 instances)
- registrySearchGateway.test.ts (2 instances)
- colorUtil.test.ts (2 instances)

Changes:
- Used `unknown` for truly unknown values instead of `any`
- Used `Partial<T>` with type assertions for mock objects
- Used `ReturnType<typeof func>` to derive proper types
- Used proper typing for promise resolvers and spy mocks
- Used `this: unknown` with proper casting for function contexts

All changes pass typecheck and tests.
2026-01-22 00:02:14 +01:00
Johnpaul
dc9f75c011 refactor: remove any types from useMinimap and firebaseAuthStore tests
- useMinimap.test.ts: Created comprehensive mock interfaces for Node, Graph, Canvas, CanvasElement, ContainerElement, and Context2D
- firebaseAuthStore.test.ts: Imported User type from firebase/auth and created MockUser type for mocking

Part 8 - Phase 5 complete: 2 files fixed, 14 any instances removed (9 + 5)
2026-01-21 23:46:43 +01:00
Johnpaul
20a0ae04cf refactor: remove any types from releaseStore, ExecuteButton, and useManagerQueue tests
- releaseStore.test.ts: Created mock interfaces for ReleaseService, SettingStore, and SystemStatsStore with proper typing
- ExecuteButton.test.ts: Added Mock type interfaces for Canvas, CanvasStore, and CommandStore
- useManagerQueue.test.ts: Fixed Ref types and used correct ManagerPackInstalled schema types

Part 8 - Phase 4 complete: 8 files fixed, 32 any instances removed
2026-01-21 22:40:55 +01:00
Johnpaul
415845a325 refactor: fix normalizeIndustry and normalizeUseCase to accept unknown
- Change parameter types from string to unknown in both functions
- Functions already have type guards (typeof check) to handle invalid inputs
- Remove all 'as any' casts from tests - no longer needed
- Better type safety: functions now properly express they can handle any input
2026-01-21 22:11:11 +01:00
Johnpaul
4014984300 refactor: remove any types from useSettingSearch.test.ts
- Import SettingParams, SettingTreeNode types from settingStore
- Replace mockSettingStore: any with ReturnType<typeof useSettingStore>
- Replace mockSettings: any with properly typed Record<string, SettingParams> with double-cast
- Replace setting: any parameter with SettingParams in getSettingInfo mock
- Replace activeCategory as any with Partial<SettingTreeNode> and proper cast
- Add casts for dynamically assigned mock settings
2026-01-21 21:59:26 +01:00
Johnpaul
d4af46327b refactor: remove any types from algoliaSearchProvider.test.ts
- Define RegistryNodePack type from comfyRegistryTypes
- Create GlobalWithAlgolia interface for global properties
- Replace (global as any) with properly typed (globalThis as unknown as GlobalWithAlgolia)
- Type testPack and incompletePack as Partial<RegistryNodePack>
- Replace as any casts with as RegistryNodePack
2026-01-21 21:55:29 +01:00
Johnpaul
acccd6c3a7 refactor: remove any types from contextMenuCompat.test.ts
- Replace ...args: any[] with proper return type annotations
- Replace (original as any).apply() with original.call()
- Replace (originalGetCanvasMenuOptions as any).apply() with .call()
- Add explicit return type (IContextMenuValue | null)[] to functions
2026-01-21 21:48:30 +01:00
Johnpaul
489af6df76 refactor: remove any types from contextMenuFilter.name.test.ts
- Import IContextMenuValue and LGraphNode types
- Replace ...args: any[] with proper parameter types (none for getCanvasMenuOptions, node: LGraphNode for getNodeMenuOptions)
- Replace (original as any).apply() with original.call() with proper typing
- Add explicit return type annotation for monkey-patched methods
2026-01-21 21:41:03 +01:00
Johnpaul
692528cd12 refactor: remove any types from systemStatsStore.test.ts
- Import SystemStats type from apiSchema
- Replace null as any with proper SystemStats type
- Replace Promise<any> with Promise<SystemStats>
- Replace partial system object cast with SystemStats['system']
- Add necessary cast for empty object in test
2026-01-21 21:24:37 +01:00
Johnpaul
9c3a94ba1a refactor: remove any types from keybindingService.forwarding.test.ts
- Replace dialogStack mock 'as any' with ReturnType<typeof useDialogStore>
- Replace undefined/null assignments with double-cast using typeof saved variables
- All 3 instances now properly typed
2026-01-21 21:20:05 +01:00
Johnpaul
ea52855142 refactor: remove any types from api.featureFlags.test.ts
- Define MockWebSocket interface with proper Mock types
- Replace mockWebSocket: any with MockWebSocket type
- Replace event: any with unknown in event handlers
- Import Mock type from vitest
2026-01-21 21:12:55 +01:00
Johnpaul
c1137c6c8f refactor: remove any types from useTemplateUrlLoader.test.ts
- Update mockQueryParams type to include string[] for Vue Router query params
- Replace params?: any with unknown and inline type assertion
- Remove unnecessary 'as any' casts from array assignments
2026-01-21 21:11:02 +01:00
Johnpaul
a6af53ff29 refactor: remove any types from SubgraphNode.titleButton.test.ts
- Define MockPointerEvent interface for canvas events
- Import CanvasPointerEvent type from events module
- Replace 3 'as any' casts with proper typed interface and double-cast
2026-01-21 21:08:59 +01:00
Johnpaul
7d16f0c9f6 refactor: remove any types from LinkConnectorSubgraphInputValidation.test.ts
- Define MockPointerEvent interface for canvas pointer events
- Define MockRenderLink interface for partial render link mocks
- Import CanvasPointerEvent type from events module
- Replace 3 'as any' casts with proper typed interfaces and double-cast
2026-01-21 21:07:00 +01:00
Johnpaul
72ed73dead refactor: remove any types from LGraphNode.test.ts
- Define NodeConstructorWithSlotOffset interface for constructor with optional slot_start_y
- Replace 3 'as any' casts with proper double-cast pattern
- All instances related to dynamic slot_start_y property on node constructor
2026-01-21 21:03:29 +01:00
Johnpaul
6219bb54af test: remove any from useNodePricing.test.ts (3 instances)
- Define MockNodeInput interface for test inputs
- Replace widgets value: any with unknown
- Replace const node: any with proper object and double-cast to LGraphNode
- Add explicit return type boolean to isInputConnected
2026-01-21 20:53:00 +01:00
GitHub Action
2381cb9810 [automated] Apply ESLint and Oxfmt fixes 2026-01-21 19:01:16 +00:00
Johnpaul
ce3985fb11 test: remove any from ColorPickerButton.test.ts (3 instances)
- Replace activeWorkflow mock with LoadedComfyWorkflow type and double-cast
- Replace selectedItems mocks with Positionable type and double-cast
- Import Mock type from vitest for checkState mock
2026-01-21 19:58:49 +01:00
Johnpaul
8574af95ea test: remove any from litegraphUtil.test.ts
- Replace widgetValues: any[] with unknown[]
2026-01-21 19:14:55 +01:00
Johnpaul
092e08df26 test: remove any from newUserService.test.ts
- Define MockSettingStore interface with proper Mock types
- Create mockSettingStoreTyped with double-cast to useSettingStore return type
- Replace all mockSettingStore usages in initializeIfNewUser calls
- Import useSettingStore type from correct path
2026-01-21 18:55:07 +01:00
Johnpaul
1e2aac04e1 test: remove any from nodeOrganizationService.test.ts
- Replace overrides: any with Record<string, unknown> in createMockNodeDef
- Replace 'unknown' as any with double-cast to NodeSourceType
2026-01-21 18:49:10 +01:00
Johnpaul
f4934bf127 test: remove mockSearchClient any from algoliaSearchProvider.test.ts
- Define MockSearchClient interface with search: Mock property
- Replace mockSearchClient: any with MockSearchClient type
- Apply double-cast when setting up mock return value
- Note: File still has other any instances for global properties and test casts
2026-01-21 18:47:50 +01:00
Johnpaul
08fc8131f6 test: remove any from textUtils.test.ts
- Replace (ctx.measureText as any) with (ctx.measureText as Mock)
- Import Mock type from vitest
2026-01-21 14:00:56 +01:00
Johnpaul
e340f028f0 test: remove any from SubgraphWidgetPromotion.test.ts
- Replace widgetValue: any with unknown in createNodeWithWidget helper
2026-01-21 12:48:07 +01:00
Johnpaul
b7f2359097 test: remove any from SubgraphSlotVisualFeedback.test.ts
- Replace mockColorContext: any with proper MockColorContext interface
- Apply double-cast at draw() call sites to satisfy DefaultConnectionColors type
- Pattern: colorContext: mockColorContext as unknown as DefaultConnectionColors
2026-01-21 03:04:43 +01:00