mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-01 19:20:10 +00:00
test: add Symbol.iterator support to createMockFileList
Add iterator implementation to createMockFileList so the mock FileList can be used with for...of loops and spread operations, ensuring full compatibility with the iterable FileList interface.
This commit is contained in:
@@ -180,7 +180,10 @@ export function createMockFileList(files: File[]): FileList {
|
||||
const fileList = {
|
||||
...files,
|
||||
length: files.length,
|
||||
item: (index: number) => files[index] ?? null
|
||||
item: (index: number) => files[index] ?? null,
|
||||
[Symbol.iterator]: function* () {
|
||||
yield* files
|
||||
}
|
||||
}
|
||||
return fileList as FileList
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user