mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 19:21:54 +00:00
test: remove explicit any type from useLoad3dDrag.test.ts
Replaced any with ReturnType<typeof useToastStore> for mockToastStore. All tests passing (13/13), 0 typecheck errors. Part of #8092
This commit is contained in:
@@ -34,7 +34,7 @@ function createMockDragEvent(
|
|||||||
}
|
}
|
||||||
|
|
||||||
describe('useLoad3dDrag', () => {
|
describe('useLoad3dDrag', () => {
|
||||||
let mockToastStore: any
|
let mockToastStore: ReturnType<typeof useToastStore>
|
||||||
let mockOnModelDrop: (file: File) => void | Promise<void>
|
let mockOnModelDrop: (file: File) => void | Promise<void>
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
@@ -42,7 +42,9 @@ describe('useLoad3dDrag', () => {
|
|||||||
|
|
||||||
mockToastStore = {
|
mockToastStore = {
|
||||||
addAlert: vi.fn()
|
addAlert: vi.fn()
|
||||||
}
|
} as Partial<ReturnType<typeof useToastStore>> as ReturnType<
|
||||||
|
typeof useToastStore
|
||||||
|
>
|
||||||
vi.mocked(useToastStore).mockReturnValue(mockToastStore)
|
vi.mocked(useToastStore).mockReturnValue(mockToastStore)
|
||||||
|
|
||||||
mockOnModelDrop = vi.fn()
|
mockOnModelDrop = vi.fn()
|
||||||
|
|||||||
Reference in New Issue
Block a user